kind3r / esp8266-xpressnet-lib

XpressNet library from Philipp Gahtow converted to run on ESP8266
5 stars 1 forks source link

State of the framework #1

Closed MichMich closed 6 years ago

MichMich commented 6 years ago

Hi @kind3r,

Awesome to see you working on this ESP version of the library. Exactly what I need. I want to make a PCB for my dad's train. I prefer to use an ESP for future possibilities, but as you know they are currently unsupported.

I was wondering what the state of the library is, if you're still working on it?

Cheers,

Michael.

kind3r commented 6 years ago

Hi @MichMich,

Thanks for the interest.

I am working on the libraries (also the z21) in my spare time. They are more or less functional as the original ones but seem to be lacking some features that I would like. You can check out the XpressNet_Z21_ESP.ino example which creates a z21 like command station out of an ESP+RS485 module.

My goal is to have a z21 like device from a low cost esp8266 with a RS485 interface and embed both into a Roco/Fleischmann 10764 Digital amplifier with a Multimouse connected to it.

I am currently working on the S88n support which does not seem to always send the data to Rocrail.

Another issue I'm having (also present in the original library) is that the commands sent by the Multimouse are ignored (because they are not addressed to us I presume) and thus not sent further on the network. On the other hand, Multimouse recognises commands sent from the network.

Any sugestions are welcome.

Emanuel.

MichMich commented 6 years ago

Great. Thanks for the info! If I'm not mistaken you are using SoftwareSerial to communicate with the max485 chip, right? I can't find the code which defines the pins. Are they fixed? Or am I misunderstanding the integration?

kind3r commented 6 years ago

Pins are defined in esp8266-XpressNet.h#L54: XNetRS485_RX, XNetRS485_TX. Normaly you should be able to override them in your scetch before including the xpressnet lib. The control pin you can specify in XpressNetClass::start.

I use a modified 9 bit SoftwareSerial version, espsoftwareRS485. Also, my RS485 shield had reverse functionality of the control pin (RX was on HIGH and TX on LOW) so I added the XControlReverse parameter to XpressNetClass::start.

MichMich commented 6 years ago

Awesome! Thanks.

kind3r commented 6 years ago

Also, I discovered later that Auto TX control worked just as well on my RS485 shield so now I don't even use the control pin :)

MichMich commented 6 years ago

Which shield do you use?

kind3r commented 6 years ago

SparkFun WiFi Shield - ESP8266 in combination with LinkSprite RS485 Shield V2.1.

Also have a few of 3.3V Auto RS485 to LvTTL RS232 Transceiver Converter SP3485 Module waiting to be tested as soon as my 12V to 3.3V regulators arrive.

MichMich commented 6 years ago

Thanks. I've successfully used this board to control the trainer using an Arduino nano. I'm now working on a PCB with the MAX485 integrated which allows me to plug in an Arduino nano or WeMos D1 Mini.

MichMich commented 6 years ago

I ended up just using the Nano which was enough for my project. If you are interested: http://michaelteeuw.nl/tagged/trainautomator