User Tools

Site Tools


raspi:esp8266-en

This is an old revision of the document!


LOLIN (WEMOS) D1 Mini


Arduino IDE

Preferences

Add to "Additional board manager URLs:

https://arduino.esp8266.com/stable/package_esp8266com_index.json

Board selection

LOLIN(WEMOS)D1 R2 & mini


LOLii

Copyright © 2002-2019 Robert Jan Versluis, Rocrail.net

LOLii is firmware for controlling Throttle or I2C.
This is WIP and not ready to use.

The source code is public but not open source licensed, and it should be used only to compile and load it on the LILON D1 Mini.

Setting up the WiFi can be done with the Arduino Serial Monitor 9600bps:

#1CConnecting to [secure.home]
#13WiFi try to connect
...
#13WiFi try to connect
#17WiFi connected RSSI=-55

Output after a ? command:

Settings:
------------------------------
ssid=secure.home
pwd=secure4home
server=mba2019
name=LOLii
id=33
io=throttle
RSSI=-52

Change settings by typing:
------------------------------
*ssid=<your WiFi SSID>
*pwd=<your WiFi password>
*server=<your Rocrail Server IP/host>
*name=<Node name>
*id=<Node number>
*io=<00000000> or <i2c> or <led> or <throttle> (0=out, 1=in, 2=block)

Default WiFi Values

The README.h file can be used for initial, first boot, WiFi and Rocrail server values.
The values must be set before compile and upload.
Afterwards those values can be changed with monitor commands.

Monitor commands

Command Description
? Shows the current settings and how to change them.
*ssid=<value> Set the WiFi access point SSID.
*pwd=<value> Set the WiFi password. A WiFi reconnect is triggered.
*server=<value> Set the Rocrail Sever IP or Name.
*name=<value> Optional node name.
*id=<value> Node number; Should be unique.
*io=<value> Simple I/O pin configuration.

Note: Replace <value> to meet the local WiFi environment.

Hardware

Throttle

AKA RICi
The pocket throttle I/O mode needs a rotary switch, one LED and four buttons.
The LED can also be the build in one. (D4)
rotaryswitch-con.jpg

Pin Usage Click Long click
D3 Rotary A - -
D4 LED - -
D6 Rotary B - -
D7 Rotary switch Change direction
(Switch to other loco with F1 pressed.)
Wait/Release loco
(Loco 2 with F1 pressed.)
D0 F1 F1 F5
D1 F2 F2 F6
D2 F3 F3 F7
D5 F4 F4 F8

Lights

F0 is flipped if both F3 and F4 are pressed.

Emergency Break

An emergency break will send to the server if both F1 and F2 are pressed.

LED Meaning
On No WiFi connection.
Very fast flashing 10Hz No Rocrail server connection.
Off Idle mode.
Fast flashing 5Hz Waiting for a dispatch.
Slow flashing 1Hz Operating mode.

Boot

At boot the LED will turn on until a WiFi connection is established.

Catch a Locomotive

  1. In case the LOLii did not catch a dispatched loco, and the rotary is pressed long, about 2 seconds, the LED will start flashing fast.
  2. If the LOLii sees in this mode a loco dispatch, it will catch it and the LED will start flashing slow.
  3. This loco catch will be saved in the flash memory and reused at reboot if it was not released.

Speed Control

  • Turn the rotary for speed changes.
  • A short rotary press will flip the loco direction.

Function Control

  1. Press the function selector button long to reset it to F0.
  2. Press the function selector button short to select a function; 1 time press will select F1, and so on.
  3. Press the function action button to flip the selected function.

Release a Locomotive

  1. Press the rotary long, about 2 seconds,
  2. A release message is send.
  3. The LED will go off.

Battery Control

The analog input will check the battery voltage.
If the voltage is below a certain level, LOLii will send automatically a zero speed command to the locomotive and a release command.
The LED will start blinking very fast as long the battery is not drained completely.

Server discovery

If the Rocrail Server has R2RNet active on multicast address 226.0.0.1, the LOLii can retrieve the server name/IP to connect it to the 8051 client port automatically.


raspi/esp8266-en.1568362880.txt.gz · Last modified: 2019/09/13 10:21 by rjversluis