users:dagnall53:description
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
users:dagnall53:description [2019/02/14 13:35] – dagnall53 | users:dagnall53:description [2019/05/06 12:12] – dagnall53 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== WiRocs DESCRIPTION ====== | ====== WiRocs DESCRIPTION ====== | ||
- | |||
- | **' | ||
- | |||
Index | Index | ||
* [[: | * [[: | ||
- | * [[: | + | * [[: |
- | * [[: | + | * [[: |
+ | * [[users: | ||
+ | |||
+ | ====== WiRocS ====== | ||
+ | WiRocS is the name for a very inexpensive way to control your RocRail railway. It is not intended to replace more professional equipment, but it does provide a simple, inexpensive, | ||
+ | WiRocS is actually ' | ||
+ | Each Node can have 8 fully programmable I/O (input/ | ||
* [[: | * [[: | ||
- | * [[: | + | * [[: |
+ | * [[: | ||
+ | * [[: | ||
+ | * [[users: | ||
+ | * [[https:// | ||
+ | * [[: | ||
* [[: | * [[: | ||
- | | + | * [[:users:dagnall53:description# |
- | | + | |
+ | ---- | ||
- | ===== Network overview ===== | + | ====== Network overview ====== |
- | The WiRocS / ESPMQTTROCNETSOUND code expects to work in a network where Rocrail is running and has a " | + | |
- | + | ||
- | {{: | + | |
+ | {{: | ||
A MQTT broker, such as Mosquitto must be running somewhere on the on the network. (It can run on either the same PC as Rocrail or a different PC). | A MQTT broker, such as Mosquitto must be running somewhere on the on the network. (It can run on either the same PC as Rocrail or a different PC). | ||
Rocrail needs to know the IP address of this MQTT broker, and this should be set in the Rocrail Rocnet Controller " | Rocrail needs to know the IP address of this MQTT broker, and this should be set in the Rocrail Rocnet Controller " | ||
Line 30: | Line 37: | ||
===== Operation ===== | ===== Operation ===== | ||
- | On power up the WiRocS | + | On power up the WiRocS |
- | Once the node finds the router it saves the MQTT Broker sub address and uses this on its next start up to save time. | + | {{: |
+ | The Nodes do not " | ||
+ | Rocrail addresses each Node by its ROCNET ID, which is usually initially set to the nodes subIP for simplicity.\\ | ||
+ | The system is therefore theoretically limited to about 250 WiRocS nodes, depending on what else the WiFI router is connecting, but the system is really designed for use with small layouts with dispersed stations, such as a Garden Railway. | ||
- | The Nodes do not " | ||
- | Rocrail addresses each Node by its ROCNET ID, which is usually initially set to the nodes subIP for simplicity. | ||
- | The system is therefore theoretically limited | + | ---- |
+ | ===I/O Pin Capabilities=== | ||
+ | Once connected | ||
+ | Every ESP8266 node provides 8 universal i/o pins. " | ||
+ | Each I/O is effectively a virtual | ||
+ | Rocview programming is used to set the functionality of each port. | ||
- | {{: | + | {{: |
- | Each node can now be individually seen and modified by RocView. | ||
- | Every ESP8266 node provides 8 universal i/o pins. " | ||
- | Each I/O is effectively a virtual | ||
- | {{: | ||
- | {{: | ||
- | |||
- | ===I/O Pin Capabilities=== | ||
PROVIDED that the Pin is not being used for an OLED display, Motor drive, Loco Front or Rear Light or other pre-defined function such as Loco Motor PWM drive, each I/O can be set by Rocrail as an input or output, using the "PI02 Port Setup" | PROVIDED that the Pin is not being used for an OLED display, Motor drive, Loco Front or Rear Light or other pre-defined function such as Loco Motor PWM drive, each I/O can be set by Rocrail as an input or output, using the "PI02 Port Setup" | ||
This allows blinking, and inversion. | This allows blinking, and inversion. | ||
+ | |||
+ | ---- | ||
+ | |||
* If the Pin is set as an OUTPUT, __and__ if the PI03 channel is set to SERVO, the pin becomes a Servo drive output. | * If the Pin is set as an OUTPUT, __and__ if the PI03 channel is set to SERVO, the pin becomes a Servo drive output. | ||
- | * If the Pin is set as an OUTPUT, __and__ if the PI03 channel is set to " | + | * If the Pin is set as an OUTPUT, __and__ if the PI03 channel is set to " |
* For both Servo and PWM outputs, the code uses the " | * For both Servo and PWM outputs, the code uses the " | ||
* "Left Steps" and "Right Steps" and " | * "Left Steps" and "Right Steps" and " | ||
- | the ESP32 code is identical, except that it has 16 programmable I/O, and the OLED I2C display uses a further | + | The ESP32 functionality |
- | * There are some limitations on the ESP32 Pins. | + | * On the ESP32 the OLED I2C display uses two pins that are not part of the 16 I/O. |
- | * Two pins (#34 and #35) can only be used as Inputs, and do not have the internal pull-up resistors that the other ports have. | + | * There are some limitations on the four of the defined ' |
- | * Two pins (#25, #26) are permanently DAC outputs, so send out 0-3.3v (as selected by their PI03 settings). | + | |
+ | | ||
- | On the ESP8266, the Sound output is driven by the Serial {Rx} Input. This needs a 1-10K ohm resistor that is connected to the base of an NPN transistor, whose collector is connected to the loudspeaker. The other Speaker connection is to 5V. This arrangement " | ||
---- | ---- | ||
- | |||
- | ==== " | + | ===== First Time Programming ===== |
- | ---- | + | |
- | The Code to compile the Node includes a lot of #Define statements that allow the code to be modified for various uses. This allows the node to be set up as a Static / or Mobile(LOCO) Node, and with or without Audio. | + | [[users: |
- | + | ===== Setting | |
- | To select " | + | |
- | + | ||
- | To use a Mobile (LOCO) node with a " | + | |
- | + | ||
- | Other pins are then "used up" by the various audio output options. | + | |
- | The Table below refers to the ESP8266 NodeMCU " | + | |
- | + | ||
- | {{:users: | + | |
- | + | ||
- | User : Port is available for user to specify as Input or Output. | + | |
- | * Port D4 is used for the onboad LED. | + | |
- | * with " | + | |
- | + | ||
- | Port usage shown above is considered " | + | |
- | + | ||
- | + | ||
- | (Some additional #defines are set or ignored depending on the defines noted above) | + | |
- | e.g: | + | |
- | + | ||
- | #ifdef _LOCO_SERVO_Driven_Port | + | |
- | # | + | |
- | # | + | |
- | // | + | |
- | #endif | + | |
---- | ---- | ||
+ | The code now has a simple method to allow changing the WiFi SSID, | ||
+ | When the code starts up, it waits for about three seconds and looks at the Serial Input and at the boot/Flash pin\\. | ||
+ | IF the program sees " | ||
+ | |||
+ | If you are using the Arduino Serial Monitor, you need to enter " | ||
- | ===== First Time Programming ===== | + | {{: |
+ | Note how the port tests for I2C ports as it wakes up, and here sees #61, so will set the (second) display settings on.\\ (#60 is always display 1, #61 is always display 2) | ||
+ | To do this PuTTY must be set up like this (but select the correct Com port for your system!) :\\ | ||
+ | {{: | ||
- | [[users: | + | If the MQTT broker address is incorrect, |
- | ===== Setting | + | |
- | + | ||
- | ---- | + | |
- | The code now has a simple method to allow changing the WiFi SSID and Password. | + | |
- | When the code starts up, it waits for about three seconds and looks at the Serial Input. IF the program sees "xxx{cr}", it will enter a dialog with the user that allows the Wifi SSID, password | + | |
- | If you are using the Arduino Serial Monitor, you need to enter " | + | |
- | When the node starts up you should see something like this: | + | |