ESP8266 MQTT Client

Special solutions for outdoor model railroading.
Post Reply
janvanderborden
Posts: 603
Joined: 06.09.2014, 16:23
Location: Heiloo

Re: ESP8266 MQTT Client

Post by janvanderborden » 02.03.2019, 21:43

Hi Casper

It is a little bit tricky entering the XXX. The best way you can do is using the arduino IDE.
First switch on the power on the dev board
Then after a very little short time you open the terminal window in the arduino ide
And directyly you type in the xxx.
I do not know which version of the ino you are using.
The questions are on the OLED display or in the terminal window

casperdeboer
Posts: 76
Joined: 12.02.2017, 21:46

Re: ESP8266 MQTT Client

Post by casperdeboer » 02.03.2019, 21:55

Hi Jan

Alkready did this a couple of times. But it won't store my pswd correctly. So I thought to use secrets. h instead. Because this allways worked with other projects of Dagnall.

Casper

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

Re: ESP8266 MQTT Client

Post by janvanderborden » 02.03.2019, 21:59

Hi Casper

are the xxx answered, can you give in new values

casperdeboer
Posts: 76
Joined: 12.02.2017, 21:46

Re: ESP8266 MQTT Client

Post by casperdeboer » 02.03.2019, 22:05

Yes and after I type in my pswd it after enter ore send it still shows the wrong pswd. So when I save it with sss it won't connect to my wifi

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 MQTT Client

Post by Dagnall » 02.03.2019, 22:07

janvanderborden wrote:
02.03.2019, 21:43
Hi Casper

It is a little bit tricky entering the XXX. The best way you can do is using the arduino IDE.
First switch on the power on the dev board
Then after a very little short time you open the terminal window in the arduino ide
And directyly you type in the xxx.
I do not know which version of the ino you are using.
The questions are on the OLED display or in the terminal window
Casper, jan,(all)
Thanks for trying the newcode fow WiRocS, but can i suggest holding more testing for a bit as i have a new version to put on github soon, with a longer and hopefully better acess to the serial changes for wifi etc.
I have also seen some trouble saving the wifi to eeprom, hopefully better in the revised version. One problem was due to differences in the way the old espwifi code saved variables and the way the new code saves them. Basically the code did not realise it had new wifi variables saved, so kept setting defaults. This did not happen if you used hardware that had once been programmed with the older espwifi code, only when programmimg a new blank hardware.
The new version also has the oled display working a bit better, but i need to do some double checking and testing before putting it all on github.

Cheers all
Dagnall

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

Re: ESP8266 MQTT Client

Post by janvanderborden » 02.03.2019, 22:10

HI Dagnall

Casper tries to connect the throttle.
Are you changing also something in the code for the throttle ?

casperdeboer
Posts: 76
Joined: 12.02.2017, 21:46

Re: ESP8266 MQTT Client

Post by casperdeboer » 02.03.2019, 22:12

Hi

OK I will wait could you please keep me updated via this topic?

Casper

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 MQTT Client

Post by Dagnall » 02.03.2019, 23:18

+casper +jan
Seeing how you are trying things out, :D :D and MANY THANKS..
.. I have just uploaded a revised version (7a) to https://github.com/dagnall53/WiRocS
I was in the middle of testing this with ESP8266/NodeMCU, but it should work also with ESP32.

I thought I had cured the "clean" hardware issue with V4, but if you are having issues, maybe I did not fully cure it. Its quite difficult to replicate problems with "clean" hardware!!
I would like to modify the Defaults in this code, but have not yet uploaded my current ESP8266 stationary node defaults to the code, so if you still get programming issues, and still cannot save the WiFi settings, Please let me know and I will start some PM to find out why..
Saving does work "best" with the arduino IDE serial terminal, and I have given you longer to try and get the xxx(return) sent . Do not forget it needs a Lr or CF, so make sure the terminal is set to send them!
Sometimes the Serial link can have trouble (long leads?), a slower interface may then be needed. Also, if you have trouble entering the correct SSID etc, you can scroll back to the beginning of setting by typing rrr then xxx instead of sss at the end.. The serial interface should give instructions for you to help..

Also-- when programming, sometimes the Arduino IDE will complain when compiling and give error, but I have found it compiles fine the second time you press upload..

If you want to use the I2C OLED it needs to be connected like this:

Code: Select all

OLED_SCL = 2;  //also known as D4 on esp 8266  
  OLED_SDA = 0;  // also known as D3 on esp 8266

The code scans for any device connected as part of setup. if it sees 60 (or 61) it will assume it has a 128*64 oled connected and send it stuff.
I have commented out some Roc Display formatting stuff for the OLED that I am working on and not happy with yet. My code here also has far too many fonts in use for publication.

Please let me have any feedback either here or by PM, it is much appreciated.
Hopefully I can get a bit of time to finish the code to my satisfaction and tidy up!!
IMG_2694 (1).JPG
:beer:
Dagnall
You do not have the required permissions to view the files attached to this post.

casperdeboer
Posts: 76
Joined: 12.02.2017, 21:46

Re: ESP8266 MQTT Client

Post by casperdeboer » 03.03.2019, 06:37

hI Dagnall

I have problems with de rocnet throttle. But wil trie the WirocS for my other projects.

CAsper

casperdeboer
Posts: 76
Joined: 12.02.2017, 21:46

Re: ESP8266 MQTT Client

Post by casperdeboer » 03.03.2019, 07:31

Hi

I cleared my eeprom took out all of the use wifimanager stuff and now it works.

Casper

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 MQTT Client

Post by Dagnall » 03.03.2019, 10:26

Casper, thanks, which Version are you using , (see line 15 of the .ino?)
Also, because the "WiRocS" code and the older "ESPMQTTRocnetSound" are so similar, it is important to let me know which one you are using!
WiRocS is ESP32 compatible and more advanced.

I have not used the WiFi manager stuff for about 2 years, but left the code in (but not used unless you selected a directive).
I think that the new Serial Input procedure is easier to use to set up the WiFi, so I may take out the WiFi Manager code in future updates,

:!: - But, I am surprised that it caused you problems :?: - To help me "develop" the code, can you PM me and let me know a bit more about how you were using the code, which version you were using and the problems you had.. :?:

Many thanks for all feedback :coding:
Dagnall

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 MQTT Client

Post by Dagnall » 03.03.2019, 13:44

Casper,
i think I may have confused you with my most recent post.
I had mis-read the note (too fast reading.. :oops: ) and thought you were trying WiRocS.. Sorry.

I am glad you have got the Throttle working.. I will certainly look at taking out the WiFi Manager stuff from the throttle.
Did you make any other changes? and which version of the Throttle code were you using?

D

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

Re: ESP8266 MQTT Client

Post by rjversluis » 03.03.2019, 13:51

Now its confusing us all...

Which sources to which hardware?

:?: https://github.com/dagnall53/RocClientThrottle.git

:?: https://github.com/dagnall53/WiRocS

The hardware I got states: ESP32-WROOM-32

Dagnall
Posts: 278
Joined: 15.05.2015, 14:41

Re: ESP8266 MQTT Client

Post by Dagnall » 03.03.2019, 13:59

Should not be confusing..but sometimes is!.

The throttle is a Client application (that Casper was having trouble with ) is on https://github.com/dagnall53/RocClientThrottle
WiRocs Is the node, using RocNet protocol (that I am working on right now). is on https://github.com/dagnall53/WiRocS
Both use MQTT. and either ESP32 or ESP8266 hardware.

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

Re: ESP8266 MQTT Client

Post by rjversluis » 03.03.2019, 14:08

So this thread is about the Client, not the Node.

Post Reply

Return to “Garden Railroads”