User Tools

Site Tools


arduino:wio-setup-en

Differences

This shows you the differences between two versions of the page.


Previous revision
arduino:wio-setup-en [2025/05/29 09:05] (current) – [CVs] rjversluis
Line 1: Line 1:
 +[[:english|{{ :hardware.png}}]][[:english|{{ :rocrail-logo-35.png}}]]
 +[[:arduino:wio-setup-fr|{{ icons:fr.png|French Version}}]][[:arduino:wio-setup-de|{{ icons:de.png|Deutsche Version}}]][[:arduino:wio-setup-en|{{ icons:uk.png|English Version}}]]
 +======WIO - Setup======
 +[[:wio:overview-en|{{ :wio:wiologo.png}}]]
 +**[[:wio:overview-en|WIO Overview]]**
 +  * **[[:arduino:wio-setup-en|WIO Setup]]** | [[:arduino:wioctrl-en|WIO Control]] | [[:arduino:amp-en|User Bitmaps]] | [[:arduino:wio-en|WIO Firmware]] | [[:wio:wio-ledscript-en|LEDScript]]
 +
 +
 + \\
 +|< >|
 +| Rocview -> Menu -> Programming -> WIO |
 +
 + \\
 +=====Remarks=====
 +  * No setup is possible if there are multiple devices with the same ID; Power on just one with that ID and change it.
 +  * :!: Check all settings after upgrading a older WIO version with a new one; Some option flags are recycled for other purposes.
 + \\
 +<html><a name="query"/></html>
 +=====Query=====
 +With a query all active WIO devices will respond with there ID, Type and configuration.\\
 +{{:arduino:wio-query-en.png?801}}\\
 +====Set====
 +With the Set button the ID, name and Type can be changed.\\
 +^ Type ^ Functions ^
 +| Control | Throttle using short IDs |
 +| LED | 32 I2C I/O and FastLED |
 +| SERVO | 32 I2C I/O and Servos |
 +| RFID | 32 I2C I/O and RFID |
 +| DCC | 32 I2C I/O and DCC CS or Booster |
 +| Mobile | 32 I2C I/O and PWM to control a H-Bridge or RC ESC |
 +| CAN | WiFi-TCP interface between 250kb CAN and Rocrail on port 5550 |
 +| Ext | ESP32: CANIO + LED + SERVO + RFID |
 +| S88 | Märklin sensor bus |
 +| IO16 | All-rounder |
 +
 +====Reboot====
 +Reboots the selected WIO module.\\
 +
 +
 +====DeepSleep/Shutdown====
 +Shutdown the selected WIO module.\\
 +All WIO modules will shutdown in case the **All** option is selected.\\
 +
 +
 +
 +====Report====
 +{{:arduino:wio-report.jpg?200}}\\
 +A usage report is generated for all WIO modules in the query.\\
 +The default program wil be started to view the CSV file.\\
 +
 +==== WEB Browser ====
 +
 +This function opens the default web browser and connects to the IP address of the selected WIO.\\
 +{{:arduino:wio-web-setup-en.png?200|}} \\
 +
 +The following settings can be configured via the web interface:
 +
 +  * IP address of the Rocrail server
 +
 +  * Name of the WIO
 +
 +  * SSID and password for the first and second WiFi connection
 +
 +After entering the desired data, click the Submit button to apply the changes.
 +
 +**List files...**\\
 +Opens the file view of the WIO's flash memory. The following files can be managed here:
 +
 +  * [[:wio:wio-ledscript-en|LED scripts]]
 +
 +  * [[:wio:wio-ioscript-en|IOScript]]
 +
 +  * [[:wio:wio-crontab-en|Crontab]]
 +
 +  * [[:arduino:amp-en#upload_by_web_browser|SPIFFS files]]
 +
 +**WiFi tracing**\\
 +With the WiFi tracing ON/OFF switch you can activate and deactivate the debug output of the serial interface, in the trace and as output in Rocview under Controller.  
 +
 +====CAM Stream====
 +In case of type CAM the streaming link can be used:
 +<code>
 +http://<IP>:8081/stream
 +</code>
 + \\
 +
 +====Show====
 +The selected WIO will flash its LED faster until the Show command is send again by pushing this button.\\
 +
 + \\
 +=====WIO Type=====
 +====Mobile====
 +H-Bridge motor support for ESP8266 and ZeroW(WIOpi).\\
 +
 +====CAN====
 +{{:arduino:wio-mbus-can-en.png?200}} \\
 +The extra service on port 5550 can be used to communicate with a CAN bus like MBUS.\\
 +A power off command is send to CAN if the WiFi or Rocrail connection is lost.\\
 + 
 + \\
 +<html><a name="setup"/></html>
 +=====Setup=====
 +{{:arduino:wio-wio-en.png?800}}\\
 +====Pulse====
 +Count of 100ms for setting the output pulse length.\\
 +Also used for dual coil switch motors.\\
 +
 +====Port====
 +===Invert===
 +Logically invert output/pulse.\\
 +
 +
 +====Serial====
 +The RX/TX pins on the ESP8266 are the same as used by the serial monitor.\\
 +The serial monitor will get read only, and swapped to another baudrate, when using the RX for other devices.\\
 +===Monitor===
 +Default serial Monitor at 57600bps.\\
 +===RailCom===
 +RailCom reader, [[:gca214-en|GCA214]], at 250.000bps.\\
 +===RFID===
 +RFID ID-12LA reader at 9600bps.\\
 +
 +For RailCom and RFID: If the serial monitor is still needed for tracing, the baudrate must be adjusted in the Arduino IDE.\\
 + \\
 +====DCC====
 +===Power monitor===
 +In combination with a H-Bridge, WIO-Drive, WIO-Prog and WIO-Boost, the power monitor must be enabled to be able to power on and short circuit detection. A WIO reboot is required.
 +
 +===Booster===
 +Use an external DCC __3V3__ signal. (1.63+)\\
 +See the IBB connector on the WIO-Boost and WIO-Drive.\\
 +It will power off automatically in case no DCC signal is detected.\\
 +
 +===RailCom===
 +Enable RailCom cutout in the preamble and idle packet.\\
 +Disable this option in case none RailCom decoders are used.\\ 
 +
 +===Fast PT===
 +Only one packet stream instead of 4 x reset plus 6 x program are send to the PT.\\
 +**Note:** Not all decoders will accept this none NMRA conform sequence.\\
 + \\
 +====Mobile servo PWM====
 +===ESC PWM===
 +In case of WIO Mobile, this option will set servo compatible PWM on the D5 pin, which can be used to connect a RC ESC. (**E**lectronic **S**peed **C**ontrol)\\
 +
 + \\
 +==== Display ====
 +===Rotate 180°===
 +Rotate the display content 180°.\\
 +===Geometry===
 +Select the connected displays geometry.\\
 +
 + \\
 +====Control====
 +===Steps===
 +Number of rotary ticks for 100% speed.\\
 +===Deep sleep===
 +Put WIO Control into deep sleep after a time out of x minutes.\\
 +===Synchronize===
 +Synchronize speed and function field events. __Disable in case of a slow network to avoid slider jumping.__\\
 +:!: This option will only work well in case the used Command Station reports speed changed at once. In all other cases the WIO-Control cannot set the loco speed.\\
 +
 + \\
 +
 +
 +====Stepmotor====
 +3 Wire Fast uses a timer interrupt for a higher stepper frequency.\\
 +Check the USERCNF.h for settings.\\
 +
 + \\
 +
 +====CAN====
 +===I/O===
 +  * For WIO-02 with an ESP32. See also: [[:arduino:wio-en#esp321|CAN Tx/Rx]].
 +  * **[[:wio:wiopico-io16can-en|Pico CAN]]**
 +===USB-Bridge===
 +Interfacing between USB and CAN.
 +  * RCAN bps=250000
 +  * MCAN bps=500000
 +===Pico CAN===
 +Option for the **[[:wio:wiopico-io16can-en|WIO-Pico-CAN]]** PCB to get the right pin mapping and 20MHz MCP2515 crystal.\\
 + \\
 +
 +====Extra====
 +===KeyPad===
 +See: __**[[:arduino:wio-en#keypad|KeyPad]]**__\\
 +===I/O1 Servos===
 +The PicoW with type IO16 supports extra 8 servos on the I/O1 connector.\\
 +The needed power supply should be also extra because the **[[:gca-wiopicow-1|WIO-PicoW-01]]** does not provide enough power for 12 servos.\\
 +
 +===PWM 100Hz===
 +**[[:wio:wio-hbridge-en|H-Bridge]]** support with hardware PWM at 100Hz.\\
 +Default is software PWM between 10 and 100Hz which can be set in the [[#control|Controller Steps]] field.(More suited for **[[:wio:wio-hbridge-en#track_driver|Track Driver]]**.)\\
 +Low PWM frequencies are not recommended for dimming lights/LEDs because it will flicker.\\
 +
 +===Sync Slave===
 +In case of software **[[:wio:wio-hbridge-en|H-Bridge]]** PWM the Sync Master will generate on the HALL pin a sync signal for 'slave' WIO's.\\
 +The slave WIO's will activate an interrupt on the HALL pin so the PWM will be in sync with the master.\\
 +This option makes only sense in case of a **[[:wio:wio-hbridge-en#track_driver|Track Driver]]** system with more then 8 blocks. (Multiple WIO's)\\
 +**Note:** //If this option is set without a master sync on the HALL pin the generated PWM is useless,//\\
 +
 +===SPI Clock===
 +Support for the **[[:wio:spi-clock-en|Adafruit GC9A01]]** display. (WIOpicoW only.)\\
 +
 +===Analog multiplex===
 +See [[:wio:anamulti-en|Analog multiplex]]\\
 +
 +===LDR===
 +LDR between 3V3 and GP28 needs 10 kOhm pulldown. (PicoW)\\ 
 +This will report the brightness to Rocrail. ([[:text-gen-en#variables|%bri%]])\\
 +
 +
 +
 + \\
 +====Preload====
 +Specify functionality at WIO startup. This prevent other 'on the fly' function by command.\\
 +|< >|
 +^ Function ^ Remark ^
 +| Servos | Initialise all 12 servos in combination with the **I/O1 Servos** extra. |
 +| PWMPair | Required in case of master PWM of multiple WIOs |
 +| DCC | |
 +| Mobile | |
 +
 + \\
 +
 +====Set====
 +With the Set button the pulse length, options and the selected I2C field can be changed.\\
 +> **Note:** //SPI communication will break because of I/O re-init; Reboot the WIO if needed.//\\
 + \\
 +
 +
 + \\
 +<html><a name="maintenance"/></html>
 +=====Maintenance=====
 +Setup the basic connections can be done on this tab:\\
 +{{:arduino:wiosetup-maintenance-en.png?600}}\\
 +  - Plug in the ESP/PicoW cable into an USB port on the computer
 +  - **Query devices**
 +  - Select the ESP/PicoW USB device from the list
 +  - **Connect**
 +  - Type in the connection parameters and push **Set**
 +
 +The WIO is ready for use.\\
 +
 +**Note 1:** Automatic Server needs an active __**[[:networking-en#setup|R2RNet]]**__.\\
 +**Note 2:** The Identify Number must be set unique among all WIO's.\\
 +
 +====Query Devices====
 +Query serial USB devices, and try to preselect one.\\
 +Click on Connect after selecting the right device to be able to communicate with the ESP/Pico.\\
 +**Note:** //Under Windows serial devices are scanned up to COM20. Higher COM ports can be typed in manually in this field.//\\
 +====Connect====
 +Try to make a 115200 baud connection with the selected serial device.\\
 +__**Notes:**__ 
 +  * //Make sure the user is in the [[:faq-en#serial_device_user_access_linux|dialout group]] to be able to connect ot the serial device.// 
 +  * //If some other process(Arduino IDE Monitor) has already a connection with the selected device, it is not possible todo the Maintenance.//
 +====DTR====
 +Activates the "Data Terminal Ready" to signal the connected microcontroller that it can send data.\\
 +//This option is temporare and should be left checked.//\\
 +
 +====Disconnect====
 +Disconnect from the serial device. This will be done automatically on closing the WIO Setup dialog.\\
 + \\
 +====WLAN====
 +===Name===
 +SSID name, without blanks, to use for the WiFi connection.\\
 +Max. length is 32 characters incl. the zero termination.\\
 +:!: //Only **[[https://en.wikipedia.org/wiki/ASCII|7 bit ASCII]]** is supported.//\\
 +===Scan===
 +Let the connected WIO module search for available networks. This will fill up the Name combobox.\\
 +===Password===
 +The password for the selected SSID name without blanks. Activating the checkbox will makes the password readable.\\
 +Max. length is 32 characters incl. the zero termination.\\
 +:!: //Only **[[https://en.wikipedia.org/wiki/ASCII|7 bit ASCII]]** is supported.//\\
 +
 +===Static IP===
 +If set to 0.0.0.0 (default) the WIO will become from the router an IP assigned.\\
 +
 +
 +===Set===
 +Sends the SSID name and password to the connected WIO module.\\
 +
 + \\
 +====Server====
 +===Name=== 
 +The DNS name or IP address of the Rocrail server.\\
 +===Automatic===
 +Use UDP Multicast, R2RNet, to find a Rocrail server.\\
 +:!: //Multicast must be enabled in the network router to be able to find the Rocrail server automatically.//\\
 +===R2RNet===
 +User besides TCP also UDP Multicast for RASCII communication. (WIP)\\
 +===Set===
 +Sends the server name to the connected ESP.\\
 +
 + \\
 +====Identity & Type====
 +===Number===
 +Unique node ID.\\
 +===Name===
 +Optional node name.\\
 +===Type===
 +WIO main function.\\
 +===Set===
 +Sends the ID and type to the connected ESP.\\
 +===Export===
 +Export settings in a CSV file.\\
 +===Import===
 +Import settings from a CSV file.\\
 +
 + \\
 +==== Terminal ====
 +Manual terminal commands field.\\
 +Press enter or click on the ">>" button.\\
 +See: **[[:arduino:wio-en#monitor_commands|Terminal commands]]**\\
 + \\
 +==== ? ====
 +Refresh the terminal with the ?<enter> command.\\
 +
 + \\
 +==== I/O ====
 +Port usage.\\
 +===Set===
 +Sends the port usage to the connected ESP.\\
 +
 + \\
 +====Debug/Info====
 +Switch between Info and Debug trace level.\\
 +
 + \\
 +====SoD====
 +Sends a start of day command to the connected ESP.\\
 +
 + \\
 +====Reset====
 +Reset the part of the Flash memory on which the WIO configuration is located.\\
 +**Tip:** //Use this if the ESP/Pico was loaded before with another sketch to get the default WIO configuration.//\\
 +
 +
 +
 + \\
 +<html><a name="update"/></html>
 +=====Update=====
 +WIO binaries for ESP8266 and ESP32 can be uploaded by OTA.\\
 +{{:arduino:wiosetup-update-en.png?600}}\\
 +  - Select the WIO on the Query tab.
 +  - Goto the Update tab.
 +  - Select the target binary; Can be downloaded __**[[https://wiki.rocrail.net/rocrail-snapshot/|here]]**__.
 +  - Adjust the OTA password if needed. (Default is "12345678")
 +  - Push the OTA button.
 +
 +====Start OTA====
 +if the file name is left empty the selected WIO module will be set in OTA mode for updating the firmware over the air by other tools like the Arduino IDE.\\
 +The number, at the right of the "Start OTA" button, is the pause in seconds between activating OTA and uploading the binary. Some microcontrollers need some more time to prepare. (ESP8266)\\
 +
 + \\
 +====OTA from Scratch====
 +To avoid bothering with the needed libraries for the WIO Sketch this {{:wio:rrota.zip|WPS-OTA-Sketch}} can be used for binary OTA:\\
 +( The Sketch can also be downloaded from https://gitlab.com/rocrail/rrota )
 +
 +  - Install the Arduino IDE.
 +  - Add the ESP boards: __**[[:arduino:wio-en#boards_manager|ESP Boards]]**__.
 +  - Flash this Sketch on the target ESP.
 +  - Open the Arduino serial monitor with 115200 baud.
 +  - Put the WiFi router/repeater in WPS mode. Alternatively, the SSID and password can be entered in Sketch, then set #define WIFI_WPS to "false".
 +  - Wait for the IP Address in the serial monitor.
 +  - Select on the Update tab in the WIO Dialog the WIO binary.
 +  - Set the IP address and port on the Update tab.
 +  - Start OTA.
 +  - Ready to setup the rest of the WIO on the Maintenance tab.
 +
 +Alternatively a mDNS browser can be used for point 4 and 6.\\
 +| {{:wio:mdns-browser-rrota.jpg}} | {{:wio:arduinoide-mdns-rrota.jpg?300}} |
 +|  Discovery  |  Arduino IDE -> Tools -> Ports -> Network Ports  |
 +
 +
 + \\
 +<html><a name="files"/></html>
 +=====Files=====
 +File management for WIO CAN.\\
 +
 +
 + \\
 +<html><a name="iomapping"/></html>
 +=====I/O Mapping=====
 +{{:arduino:wio-iomapping-en.png?800}}\\
 +
 +:!: Setting I/O Mapping on an ESP32 board will make the I/O incompatible with existing GCA WIO modules. The alternative usage as listed between brackets will be set.\\
 +
 +The I2C, SPI and UART pins can not be changed and are only listed up for information purpose.\\
 +
 +__Connector mappings:__
 +  * [[:wio:wiopico-io16-en#pins|WIOpico 16 I/O]]
 +  * [[:wio:wio03-io16-en#pins|WIO-03 ESP32 16 I/O]] 
 +  * [[:wio:wio-hbridge-en|PWM-Pairing (Multi H-Bridge)]]
 +
 +====Get====
 +Request the active I/O mapping from the selected WIO.\\
 +====Set====
 +Set the I/O mapping to values on this tab. A reboot is required.\\
 +The settings are saved in the file system as "/iomap.bin".\\
 +====Reset====
 +Reset the I/O mapping to the defaults. A reboot is required.\\
 +====Reboot====
 +Reboot the WIO to make the I/O mapping changes active.\\
 +
 +
 +
 + \\
 +<html><a name="usercv"/></html>
 +=====User CV===== 
 +====Interface====
 +{{:arduino:wio-usrcv-en.png?800}}\\
 +===Preset===
 +A list of defined user CVs.\\
 +===CV#===
 +:!: If set out of range the WIO will crash! Use the Preset selection.\\
 +===Value===
 +16bit CV value.\\
 +===Get===
 +Get the value from the WIO.\\
 +===Set===
 +Set the value.\\
 +===Reset===
 +Delete the ''usrcv.bin'' and restore the default value. A WIO reboot can be necessary.\\
 +
 +====Location====
 +{{ :arduino:usrcv.bin.png?200}}
 +The User CVs are saved in the usrcv.bin file.\\
 +Deleting this file will cause using the default values after the next reboot.\\
 +
 +====CVs====
 +|< >|
 +^ CV# ^ Description ^ Range ^ Default ^ PicoW ^ ESP32 ^ ESP8266 ^ Remark ^
 +|  0  | LED_ShowMode | 0=off, 1=on |  1 | | | | Show onboard LED flashing to show operation mode |
 +|  1  | User_Sound | 0=off, 1=on |  0 | | | | User sound over DAC |
 +|  2  | Bat_2S_Full  | 0...4095 | |  2520 |  2400 |  630 |
 +|  3  | Bat_2S_Empty | 0...4095 | |  2220 |  1670 |  480 |
 +|  4  | Bat_3S_Full  | 0...4095 | |  3310 |  3170 |  850 |
 +|  5  | Bat_3S_Empty | 0...4095 | |  2680 |  2570 |  690 |
 +|  6  | Bat_4S_Full  | 0...4095 | |  3470 |  3890 |  960 |
 +|  7  | Bat_4S_Empty | 0...4095 | |  3200 |  3090 |  760 |
 +|  8  | Servo_Min_Pulse | 500...1000 |  700 | | | | Check used servo types for the right value |
 +|  9  | Servo_Max_Pulse | 2000...2500 |  2300 | | | | Check used servo types for the right value |
 +|  10  | Display_Keypad_Line | 0...7 |  2 |
 +|  11  | Stepper_ISR_US | |  150 | | | | Number of micro seconds for timer interrupt |
 +|  12  | Stepper_ISR_Accel | |  50 | | | | Start/end delay (number of steps for accelerate and decelerate) -> range |
 +|  13  | Stepper_ISR_Accel_Step | |  15 | | | | Number of ticks before add/subtrackt accelerate and decelerate -> speed |
 +|  14  | User_altitude |  |  104 | | | | https://whataltitude.com |
 +
 +
 +Battery levels depends on board and used resistors.\\
 +The ESP8266 battery range is 10bit: 0...1023\\
 +===Battery resistors===
 +<code>
 +(+)--[100k]--(ain)--[33k]--(-) 
 +</code>
 +
 +
 + \\
 + \\
 +
 +=====Trouble Shooting=====
 +
 +====WiFi Connection (DE)====
 +Im FritzBox WEB Oberfläche gibt es ein Möglichkeit um WiFi Verbindungen zu protokollieren:\\
 +FritzBox -> System -> Ereignisse -> WLAN\\
 +Option //"Auch An- und Abmeldungen und erweiterte WLAN-Informationen protokollieren"// dazu schalten und übernehmen.\\
 +Danach der WIO versuchen lassen eine Verbindung auf zu bauen. Dann auf "Aktualisieren" klicken um nach zu schauen wie es um dem Verbindungsversuch gelaufen ist.\\