ESP8266 MQTT Client

Special solutions for outdoor model railroading.
Post Reply
Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 MQTT Client

Post by Dagnall » 07.01.2019, 18:07

Whist working on another project I have found that NodeMCU boards have a fairly large pull down resistor
Pin D8 is esp8266 pin 15. This pin is one of the boot configuration pins and for use on a dev board, it must be pulled down at boot. So the NodeMcu has a pull down circuit on this pin and the internal pullup is weaker then this external pulldown.
This means that whilst the pin can be used for outputs, It cannot be used as a simple hall effect pull-up like the other pins. I do not think that this has any connection to your problem, but thought I would note it here in case anyone else has seen this effect and got confused.
Cheers
D

rjversluis
Site Admin
Posts: 42309
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: ESP8266 MQTT Client

Post by rjversluis » 28.02.2019, 14:42

Hi Dagnall,

Peter made me your throttle:
mqtt-throttle.jpg
...My compliments!

But, the connected Rocrail has 3 locos, but your throttle listed only one.
Can you give me a hint?
You do not have the required permissions to view the files attached to this post.

rjversluis
Site Admin
Posts: 42309
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: ESP8266 MQTT Client

Post by rjversluis » 28.02.2019, 16:12

Hi Dagnall,

OK, the first loco is in hold state.
If I remove the hold state the throttle shows 2 locos, not 3.

rjversluis
Site Admin
Posts: 42309
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: ESP8266 MQTT Client

Post by rjversluis » 28.02.2019, 16:38

Hi,

both attributes defaults to "true" if they are not part of the streamed data:

Code: Select all

                       if (!same){// NEW ...added check for show="true";  and active="true"
                        _Show=ParseforAttribute("<lc id=\"","show=\"",'\"',payload,Length);
                        _Active=ParseforAttribute("<lc id=\"","active=\"",'\"',payload,Length);
                        //Serial.print (" found<");Serial.print(_Show);Serial.println ("> ");
                        
                        if ((_Show=="true")&&(_Active=="true")){
so, just check on false instead of true. ;)

Code: Select all

if ((_Show=="false")||(_Active=="false"))
 // SKIP
I solved the problem by opening the loco properties and close it with OK. Then both attributes are also in the XML.
Now all three locos are listed.
'Kewl'. ;)

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 MQTT Client

Post by Dagnall » 28.02.2019, 18:35

Rob,
I had not realized that Peter had made you a throttle.. It looks better than mine!.
Also Sorry for not spotting the forum question sooner!. :oops:
I had understood that the show="true" variable decided if the Loco was shown on the RocView table.. (or not). I think Peter said that his club hides unused locos by having them "not shown? Also same with "active=" if Active I show them on the throttle list..So the intent was that only "active" and "show" locos would be displayed on the throttle..

But your modification works as well!!! I suppose it depends on how people use RocView..

PS your WiFi signal looks weak!! :wink:
(and has Peter modified the "power on" box indicator to "Go"?? :?: ))

Cheers
D

rjversluis
Site Admin
Posts: 42309
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: ESP8266 MQTT Client

Post by rjversluis » 28.02.2019, 19:04

Hi Dagnall,
But your modification works as well!!! I suppose it depends on how people use RocView..
normally those attributes are in the XML, but if not it should be regarded as true.
PS your WiFi signal looks weak!! :wink:
Yes, it seems that the WiFI of this unit cannot handle Mesh.
(and has Peter modified the "power on" box indicator to "Go"?? :?: ))
Don't know; Show me the original.

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 MQTT Client

Post by Dagnall » 28.02.2019, 19:16

rjversluis wrote:
28.02.2019, 19:04
rather better WiFi :wink:
Not a great photo, but ok..
Case off because I still have not modified it so you can see the bottom line :oops:
IMG_2680.JPG
You do not have the required permissions to view the files attached to this post.

rjversluis
Site Admin
Posts: 42309
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: ESP8266 MQTT Client

Post by rjversluis » 02.03.2019, 10:25

Hi Dagnall,

did Fred, a friend of Peter, contact you because of the source modifications?
It would be better to keep further development in sync instead of 'island solutions'...

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 MQTT Client

Post by Dagnall » 02.03.2019, 15:11

rjversluis wrote:
02.03.2019, 10:25
Hi Dagnall,

did Fred, a friend of Peter, contact you because of the source modifications?
It would be better to keep further development in sync instead of 'island solutions'...
No, I have not had any communications from Fred. I am in email contact with Walter Sax about getting a RocDisplay "like" OLED running on my WiRocS node, and I had a lot of PM discussions with JanVanderboden on the Throttle.
I'm not sure what "island modifications" Peter/Fred have made, perhaps its just the "GO/STOP" in place of my Power on box.. This is not a big modification.. Jan want me to try and add signal aspect notification, and that is a lot harder!.

My Source code for the Throttle is on Github https://github.com/dagnall53/RocClientThrottle

I have not put "your" modification onto the throttle github (yet)

Code: Select all

if ((_Show=="false")||(_Active=="false"))
 // SKIP


D

rjversluis
Site Admin
Posts: 42309
Joined: 10.04.2006, 08:48
Location: Speyer, Germany
Contact:

Re: ESP8266 MQTT Client

Post by rjversluis » 02.03.2019, 15:51

Even with open source, we should be open. ;)
Fred did made some small modifications AFAIK, but never the less it would be better for all to communicate and maintain one source base.
One thing I'm told is that Fred did increase the time to put the throttle in programming mode.
I do not have any direct contacts with Fred, I'm only informed by Peter...

Your throttle solution is good and easy to handle, and it would be a shame to see it drifting apart.

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 MQTT Client

Post by Dagnall » 02.03.2019, 16:55

rjversluis wrote:
02.03.2019, 15:51
Your throttle solution is good and easy to handle, and it would be a shame to see it drifting apart.
Thanks.. I do not think it will "drift apart", and hopefully any improvements will be added to the master Github so all can play.
Dagnall

Liviu M
Posts: 949
Joined: 03.12.2011, 20:44

Re: ESP8266 MQTT Client

Post by Liviu M » 02.03.2019, 18:18

Hi Rob,
rjversluis wrote:
02.03.2019, 15:51
and maintain one source base.
I think the best way is for Fred to do pull requests on Dagnall's git repository.
But Fred should create himself one github account, clone the Dagnall's repository, made the changes and made a pull request.

Liviu

PS I'm sure you know that, but maybe Fred is reading this topic. ;)

casperdeboer
Posts: 76
Joined: 12.02.2017, 21:46

Re: ESP8266 MQTT Client

Post by casperdeboer » 02.03.2019, 21:16

Hi

I triing to connect the throttle but it won't remember my wifi password correct. Can I just use secrets.h and how can I than turn off the wifi settings.

Casper

janvanderborden
Posts: 600
Joined: 06.09.2014, 16:23
Location: Heiloo

Re: ESP8266 MQTT Client

Post by janvanderborden » 02.03.2019, 21:23

Hi casper

you can use the secret.h settings.

you need not to turn off the wifi settings

casperdeboer
Posts: 76
Joined: 12.02.2017, 21:46

Re: ESP8266 MQTT Client

Post by casperdeboer » 02.03.2019, 21:32

But how I filled in the secrets. h with my ssid pswd. But it won't connect. If I do xxx at startup it still does not show the correct pswd.. Normally I can cremment the line where the wifimanager is looking to use secrets.h or the manager. But I can't find it.

Casper

Post Reply

Return to “Garden Railroads”