ESP8266 for remote sensors and points.

Moderator: Moderators

Re: ESP8266 for remote sensors and points.

Postby Liviu M » 04.06.2016, 17:26

Hi,

I've put the html code in the ESP8266's file system. You can read more about it on the esp8266 git hub documentation.
I don't have any Idea why your setup doesn't work. Unfortunately my setup is in the moment break apart, I can't really test anything.

Regards,
Liviu
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: ESP8266 for remote sensors and points.

Postby Dagnall » 04.06.2016, 17:54

I have discovered I needed to add the spiffs into arduino ..
https://github.com/esp8266/Arduino/blob/master/doc/filesystem.md#flash-layout

At least the web server now looks very nice...
Unfortunately no other changes to what happens....
Dagnall
 

Re: ESP8266 for remote sensors and points.

Postby Dagnall » 04.06.2016, 18:05

Looks like our messages were being typed at the same time, I see you referenced me to the same github...

If you get a chance (when convenient!) to modify your rfid code to remove the rfid part and set it as a simple "test", just checking port status on the ESP and sending it to rocrail, that would be very helpful...

I will keep stumbling along and see what I can do here along the same lines.

a couple of things you can clarify perhaps:
: The loconet controller "hostname" is 224.0.0.1, (port 1235), but I assume that has nothing to do with my IP addresses (192.168.x.x)? I assume it is some addressing that loconet uses "internally"
: Also there is a "Local IP" field in the LocoNet Interface, that is currently blank... should that be filled in with either the Esp8266 IP address(192.168.0.22 for me) or the IP address of the PC running Rocrail (192.168.0.5)?

Many thanks for the instructions!. ( I will certainly use the internal file system in future for any web pages...)

Dagnall
Dagnall
 

Re: ESP8266 for remote sensors and points.

Postby Liviu M » 04.06.2016, 18:29

Hi,

The broad IP (224.0.0.1:1235) is the address the Rocrail is using to send/receive the Loconet messages.
The local IP is the IP the ESP8266 gets from the DHCP server, address that you can use to connect at the board through the web browser.

Regards,
Liviu

PS On the rfid2wifi github I have a _multi branch. Chances are that that branch has a newer stand. You can give it a try, but with more precautions, it is even more untested. For example, I've done some tests with real IP addresses, not broadcast and I think the active addresses are the "wrong" ones.
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: ESP8266 for remote sensors and points.

Postby Dagnall » 04.06.2016, 18:56

Thanks, I just tried the multi branch version and its "different".. for me i cannot get the webserver working, and it loops with what looks like some debug information if it helps you in your developments.

RE the broadcast loconet address 224.0.0.1 , Have I missed something very significant? Is this the address that some loconet hardware interface on the pc uses on the loconet wiring?
I do not have any loconet hardware........

..........I thought that the "LocoNet" controller set for "lnudp" allowed the PC to communicate directly with the esp8266 .. ? was I wrong?

also, do you think that the standard router port blocking might need to be modified or be causing the problem?

I am going to try (force) allow the ESP8266 ip address to be able to use UDP on port 1235 in case that is the problem...











***************************************************************************
RFID to WIFI Board

Soft WDT reset

ctx: cont
sp: 3ffeff20 end: 3fff0190 offset: 01b0

>>>stack>>>
3fff00d0: 00241001 00000001 3ffef170 3ffef070
3fff00e0: 00000002 3ffeefc4 3ffef020 40207d2b
3fff00f0: 402010ae 00000001 00000032 402010a3
3fff0100: 0000000b 00000010 3ffeefc4 40207ea9
3fff0110: 401054da 3ffe8374 3ffeefc4 40207f3a
3fff0120: 0000000b 3ffef020 3ffef130 40207f93
3fff0130: 3fffdad0 3ffef044 3ffef130 40206e16
3fff0140: feefeffe feefeffe feefeffe feefeffe
3fff0150: 00000062 00000100 00000001 feefeffe
3fff0160: feefeffe feefeffe feefeffe 3ffef15c
3fff0170: 3fffdad0 00000000 3ffef154 4020a364
3fff0180: feefeffe feefeffe 3ffef170 40100718
<<<stack<<<

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1264, room 16
tail 0
chksum 0x0f
csum 0x0f
~ld


***************************************************************************
RFID to WIFI Board
rl
Dagnall
 

Re: ESP8266 for remote sensors and points.

Postby Liviu M » 04.06.2016, 19:17

Hi,
Normally you don't need any (extra) Loconet equipment, but the rfid2wifi behaves like one (it uses the Loconet messages to communicate with the PC). For that reason you should use a Loconet CS in Rocrail and should use the defaults the Rocrail is using for the "Loconet over UDP".
I don't know why the sketches are not working, and as I can't test anything, maybe will be better for you to look for something else to solve your needs.

Regards,
Liviu
Last edited by Liviu M on 05.06.2016, 06:38, edited 1 time in total.
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: ESP8266 for remote sensors and points.

Postby Liviu M » 04.06.2016, 20:22

I've put a note on the github, indicating the sketches are not working and should be used as bases for further development.
Until I'll have the time to fix them, I'll remove the link from my signature.

Regards,
Liviu
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: ESP8266 for remote sensors and points.

Postby Liviu M » 05.06.2016, 08:26

Hello Rob,
Today I've restored a part of my setup and could do some tests with the ESP8266 board.
Because I also have communication problems between Rocrail and the ESP8266, and because it definitely used to work, I've used the wireshark to follow the messages "in the air".
If I correctly interpret the wireshark messages, Rocrail sends the query as UDP package and my board is answering with correct (at least correct formated) package.
I'm attaching a wireshark Screenshot, showing the correct message send by the ESP8266, and a snippet from the last trc, with the last messages sent & received by Rocrail.
As you can see, in the traces (and in the server window) there are no signs of the responses send by ESP.
And now the question - have you change something in the LNUDP library in the last time? Or I'm just doing something wrong with the message and Rocrail is just ignoring it?

Thanks,
Liviu

LE Server IP is 192.168.1.23, ESP IP is 192.168.1.12.
You do not have the required permissions to view the files attached to this post.
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: ESP8266 for remote sensors and points.

Postby rjversluis » 05.06.2016, 08:50

Hi Liviu,

I did not change anything in LNUDP.
If you have 2 ore more Ethernet devices in your PC you must set the local IP too.
Or you have a firewall issue.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: ESP8266 for remote sensors and points.

Postby Liviu M » 05.06.2016, 09:08

Hi Rob,

thanks, you are the best. :)
It was the firewall, not full configured after reinstalling my PC.
Since the wireshark and Rocrail are running on the same computer and the wireshark has seen the messages, I was thinking the Rocrail should see them also, but wasn't the case. Deactivating the firewall done the trick.

Thanks again!

@Dagnall: if you still want to play with my sketch and want to test the communication esp-rocrail, you can comment out the rfid reading part.
Put #if 0 before rfid reading part (around line 270). Should looks like:
Code: Select all
#if 0
    // Look for new cards

end #endif after it (around line 327), to have something like:
Code: Select all
  } //if ( mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial()){   
#endif

To see more info in the Arduino's monitor, you can activate the debug messages - change the line 133 from
Code: Select all
#define _SERIAL_DEBUG  0
to
Code: Select all
#define _SERIAL_DEBUG  1


Regards,
Liviu
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: ESP8266 for remote sensors and points.

Postby Liviu M » 05.06.2016, 11:36

Hi,
I've just updated the rfid2wifi repo with a version detecting the presence of the reader and activating the tag reads only if the reader is present. The debug messages are also active.

Regards,
Liviu

PS With other words, for me the ESP is communicating with Rocrail.
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: ESP8266 for remote sensors and points.

Postby Dagnall » 05.06.2016, 12:10

I was working on some tests and saw you had uploaded the new version, I'm just trying it now..

I still get "timeout on reply " when I "Query" Loconet ..

Next question.. what was your firewall issue??.. I have a firewall on the PC , + firewall on the router..
Not sure if they are affecting things...
Dagnall
Dagnall
 

Re: ESP8266 for remote sensors and points.

Postby rjversluis » 05.06.2016, 12:21

Dagnall wrote:Not sure if they are affecting things...

you must know how to configure your firewall.
Otherwise disconnect your PC from Internet and disable the firewall(s).
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: ESP8266 for remote sensors and points.

Postby Liviu M » 05.06.2016, 12:25

Hi,
the timeout messages after an address query are normal as long as you have the default address (81) in the General tab. They just inform you that the address 81 is not available.
Important is to have your board's address detected and shown in the Address tab after a query.

About firewall, I'm using openSuse and it installs a firewall by default. Allowing UDP packages for the port 1235 solved my communication problems.
To exclude firewall problems, you can try to deactivate the firewall of your PC running the Rocrail. I don't think the router's firewall is breaking your communication (but I cannot be sure, of course).

Regards,
Liviu
----------------------------------------------
System: DCC N-Scale
CS: Profiboss (Loconet)
Server: RaspberryPi/OdroidC1/OpenSuse
Client: OpenSuse/Windows(?)
----------------------------------------------
Liviu M
 

Re: ESP8266 for remote sensors and points.

Postby Dagnall » 05.06.2016, 12:31

Thanks (!)....
Yes I know how to work the firewall, what I wanted to know was exactly what livius had found was stopping his working, so I could "allow it" ( just seen he has answered)

Disconnecting from the Ethernet will simply physically remove my ability to communicate with the esp wifi, so is not something appropriate for this particular fault finding set of tests...
I might try removing my broadband connection and disabling the router firewall, but if that works, I will still need to know what ports, ip etc need to be enabled....

My PC is just rebooting, to see if that helps. Also I did download and install the very latest rocrail build..

Windows has some default udp settings for rocrail that allow all udp to all ports, so I don't think it's the Windows firewall..


Cheers!
D
Dagnall
 

PreviousNext

Return to DIY Hardware