Mobile Rocmouse

Post Reply
drblack
Posts: 55
Joined: 10.05.2008, 13:02
Location: Quickborn, S-H

Re: Mobile Rocmouse

Post by drblack » 17.11.2018, 22:58

Hi Dagnall,

thanks for your reply.
To me it seems that the mqtt message is not properly received by the ESP8266. Rocrail sends data as requested but there is nothing in the logs showing up.
I set up a clean arduino to make sure that there is nothing else in the background. But still the same.
I am running out of ideas...
If you have your system running at certain point, maybe we can double check versions of libs etc.

Best,

Henning

Dagnall
Posts: 205
Joined: 15.05.2015, 14:41

Re: Mobile Rocmouse

Post by Dagnall » 18.11.2018, 20:09

Still away from home....
But not sure what you mean by rocrail is sending but esp is not receiving.
To get the throttle to find what locos are present, it first sends a command to rocrail, which then sends back lots of data telling the throttle what locos the layout has. The throttle the can display the lock names to let you select one to control.

You must have rocrail set up with a rocnet controller with sub library set to use mqtt transmission. You must have a mqtt broker and set its address in the mqtt settings, with port set to 1883 the esp will need to have the same broker address settings so it can communicate with rocrail, and searches ( or did in early versions, I need to check this). addresses xxx.xxx.xxx.3-49 in sequence looking for the broker. If your broker has an address outside this range you will need to modify the code to allow the esp to find the broker. If you have the arduino serial monitor active when the esp is switched on you should see the search for the broker and then it finding the broker. I have modified some later code to explicitly look for a specific broker address as this speeds up reconnection if there is connection loss. Obviously if you are using this version ( sorry to be vague here) then you must explicitly program the esp with the broker address. I probably need to add some comments about this in my user pages. There are some illustrations in my user pages about the system. If they are not clear enough I will try to improve them when I get back home.
Dagnall

drblack
Posts: 55
Joined: 10.05.2008, 13:02
Location: Quickborn, S-H

Re: Mobile Rocmouse

Post by drblack » 19.11.2018, 21:16

Hi Dagnall,

thanks for all your help.
It was simple and the mistake on my side. I didn't see your comment in MQTT.cpp:

Code: Select all

// put these in pubsubclient.h
#define MQTT_VERSION MQTT_VERSION_3_1 //Rocrail needs to use V 3_1 not 3_1_1 (??)
#define MQTT_MAX_PACKET_SIZE 25000   // lclist is LONG...!
Especially the hint in the first line :shock:
There is a saying in German: "Wer lesen kann, ist klar im Vorteil"
Would tranlsate into something like: Who can read clearly got an advantage. :wink:

Now I can control the locos.

Dagnall
Posts: 205
Joined: 15.05.2015, 14:41

Re: Mobile Rocmouse

Post by Dagnall » 20.11.2018, 20:05

I am super glad that you niw have it working.
Its sometimes very difficult to find why someone has problems, but hopefully people reading these forums can see 'typical' issues and it will help them.

I had forgotten that the pubsubclient needed modification! But I did remember that inhad problems with long messages, and that Rob modified the rocrail code to send each loco separately to help.. Originally he sent All (!) the loco data as a single message, so you were limited to only a very few locos.

I hope you have fun with the throttle!
If you design a case that allows you to hold the board so you do not cover the antenna, let me know!

Dagnall

Post Reply

Return to “RocNet”