ESP-EASY including SER2NET?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
postman976
New user
Posts: 2
Joined: 03 Nov 2015, 12:27

ESP-EASY including SER2NET?

#1 Post by postman976 » 03 Nov 2015, 12:34

Hello,

I would like to request the option SER2NET into the ESP-Easy firmware.

Application purpose:
- Opentherm gateway serial communication with domoticz (option to connect ESP directly to opentherm gateway)
- P1 Smart-meter serial communication with domoticz (option to connect ESP directly to P1 Smart-meter)

Thanks in advance!

Best regards,

Albert

gjnijenhuis
New user
Posts: 1
Joined: 03 Nov 2015, 12:03

Re: ESP-EASY including SER2NET?

#2 Post by gjnijenhuis » 04 Nov 2015, 07:58

I am also looking for exactly this functionality.

I realy love the simplicity of the ESP-EASY firmware and would like to use it to connect my serial devices (OTGW and P1 meter) to Domoticz through WIFI.

Hope this can be implemented :)

rtenklooster
Normal user
Posts: 320
Joined: 15 Apr 2015, 14:17

Re: ESP-EASY including SER2NET?

#3 Post by rtenklooster » 04 Nov 2015, 20:14

Yes, i love this functionality, bot no, it has nothing to do with the espeasy.
It would be nice to use a 3 dollar esp module instead of a 25 euro costing rPi, but as far as i have seen, there are some sketches already.

What i mean with nothing to do with esp, it has nothing to do with switches, sensors, actuators and other stuff. So there is no further connection with the esp easy then domoticz and the esp module. I don't se how it should be implemented in the current sketch, i see it as a stand alone code.
Richard - Groningen (NL) - Image

Mediacj
Normal user
Posts: 24
Joined: 15 Aug 2015, 15:05

Re: ESP-EASY including SER2NET?

#4 Post by Mediacj » 05 Nov 2015, 20:52

This is a serial firmware for esp8266 which I use for a P1 smartmeter and OTGW to Domoticz:

https://github.com/eriksl/esp8266-universal-io-bridge

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: ESP-EASY including SER2NET?

#5 Post by Deennoo » 06 Nov 2015, 09:04

I just finish a RFLink wifi using ser2net on esp8266 sp1 : plug Mega Rx to esp RX, Mega TX to Esp TX, Power On, creat RFLINK gateway with LAN and rock and roll, recieving sending works like USB !

I found a more small skecth to upload on esp8266 : https://github.com/dparnell/esp8266-ser2net

I made a pull request to correct a compilation error.
Capture.JPG
Capture.JPG (63.03 KiB) Viewed 23205 times

postman976
New user
Posts: 2
Joined: 03 Nov 2015, 12:27

Re: ESP-EASY including SER2NET?

#6 Post by postman976 » 06 Nov 2015, 09:49

rtenklooster wrote:Yes, i love this functionality, bot no, it has nothing to do with the espeasy.
It would be nice to use a 3 dollar esp module instead of a 25 euro costing rPi, but as far as i have seen, there are some sketches already.

What I mean with nothing to do with esp, it has nothing to do with switches, sensors, actuators and other stuff. So there is no further connection with the esp easy then domoticz and the esp module. I don't se how it should be implemented in the current sketch, i see it as a stand alone code.
Hello Richard,

Thanks for your reply.

I actually don't agree with your statement that this function would not fit in to the easy esp system, since the P1 Smart meter and OTGW are also "sensors", but in a broader sense. Maybe you could add these "sensors" instead of a SER2NET functionality?

Martinus

Re: ESP-EASY including SER2NET?

#7 Post by Martinus » 07 Nov 2015, 16:32

Okay, running a serial to net bridge on an ESP Easy multisensor is certainly questionable. But just to see if it could work I decided to have a go with it in combination with an RFLink and Domoticz.
Easy_ser2net.png
Easy_ser2net.png (6.36 KiB) Viewed 23154 times
It seems to work. If I toggle the Kaku remote, the lightbulb in Domoticz switches accordingly and I can also see some traffic in the weblog on the ESP Easy:

Code: Select all

392683 : 10;PING; 
392726 : 20;C6;PONG; 
399300 : 20;C7;Kaku;ID=44;SWITCH=13;CMD=OFF; 
401071 : 20;C8;Kaku;ID=44;SWITCH=14;CMD=OFF; 
403772 : 20;C9;Kaku;ID=44;SWITCH=15;CMD=OFF; 
403783 : 20;CA;Xiron;ID=9200;TEMP=00c2;HUM=81;BAT=OK;
But maybe this needs a dedicated sketch anyway. Like the ones that have been posted earlier in this thread.

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: ESP-EASY including SER2NET?

#8 Post by Deennoo » 08 Nov 2015, 13:03

Thx for your Job Martinus !

Please add aviablity to set 2 server :

Actually, we can connect 2 clients but only first got serial, second connect but dont have anything.

After more test, when ESP is plug, USB can only recieve sending don't works.

Martinus

Re: ESP-EASY including SER2NET?

#9 Post by Martinus » 08 Nov 2015, 13:40

What do you mean by "Please add aviablity to set 2 server" ? You mean running two servers on the same ESP module?
The ESP has only one serial connection so I think we can use only one serial-tcp bridge.

I have done some more testing and the ESP has worked with Domoticz for 12 hours now. But it seems that if the ESP is rebooted (for whatever reason), the link cannot recover from this situation.

You will get this in the Domoticz log:

Code: Select all

2015-11-08 13:26:18.730 Error: RFLink: Not received anything for more then 30 seconds, restarting...
And that's the last message you will see...

So not very robust yet. Could be the RFLink code or the ESP code or just both. If I check the ESP after reboot with telnet, the ESP seems ok and listening on it's configured port (9999).

If I disable and enable the RFLink on Domoticz, it will start to work again:

Code: Select all

2015-11-08 13:28:35.752 RFLink: TCP/IP Worker stopped...
2015-11-08 13:28:43.150 RFLink: connected to: 192.168.0.222:9999
I don't think this will make good friends in it's current state. I can push my local repository to github so others can have a go with it. As long as all of you out there remember that github is development branch, certainly not stable.

(but of course stable is also not stable :lol: :lol:, so who am I kidding... )

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: ESP-EASY including SER2NET?

#10 Post by Deennoo » 08 Nov 2015, 14:43

Martinus wrote:What do you mean by "Please add aviablity to set 2 server" ? You mean running two servers on the same ESP module?
The ESP has only one serial connection so I think we can use only one serial-tcp bridge.
Yes, not really usefull for everybody but for me yes, got a server (10 year old squeeze none upgradable,who can't accept RFLink on usb).

As real ser2net server allow multiple client connection to the same server using différent TCP port, juste thinking it's possible with ESP, if not, i will made a seconde rflinkwifi just for test machine.
Martinus wrote:I have done some more testing and the ESP has worked with Domoticz for 12 hours now. But it seems that if the ESP is rebooted (for whatever reason), the link cannot recover from this situation.

You will get this in the Domoticz log:

Code: Select all

2015-11-08 13:26:18.730 Error: RFLink: Not received anything for more then 30 seconds, restarting...
And that's the last message you will see.
Got this too, isn't it a Domoticz problem as ser2net is ok, and RFLink too.

Once again thanks for your sharing !

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: ESP-EASY including SER2NET?

#11 Post by BertB » 08 Nov 2015, 16:11

@Martinus
How did you connect RFLink to the ESP in SER2NET mode?

Martinus

Re: ESP-EASY including SER2NET?

#12 Post by Martinus » 08 Nov 2015, 16:53

BertB wrote:@Martinus
How did you connect RFLink to the ESP in SER2NET mode?
Quite simple, just like you would connect a 5V FTDI to an ESP-01.
RX to TX, RX to TX, using some sort of level shifting.

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: ESP-EASY including SER2NET?

#13 Post by Deennoo » 08 Nov 2015, 17:12

Ser2net on ESPeasy can ne use for this case to :http://www.esp8266.nu/forum/viewtopic.php?f=6&t=84

Using an optocoupler french Elec counter provid his information on a serial format.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: ESP-EASY including SER2NET?

#14 Post by BertB » 08 Nov 2015, 18:03

Martinus wrote:
BertB wrote:@Martinus
How did you connect RFLink to the ESP in SER2NET mode?
Quite simple, just like you would connect a 5V FTDI to an ESP-01.
RX to TX, RX to TX, using some sort of level shifting.
As far as I know, RFLink uses only one serial port for communication and that one is connected with the USB device. So I wonder, does that not cause a conflict?

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: ESP-EASY including SER2NET?

#15 Post by Deennoo » 08 Nov 2015, 18:16

BertB wrote:
Martinus wrote:
BertB wrote:@Martinus
How did you connect RFLink to the ESP in SER2NET mode?
Quite simple, just like you would connect a 5V FTDI to an ESP-01.
RX to TX, RX to TX, using some sort of level shifting.
As far as I know, RFLink uses only one serial port for communication and that one is connected with the USB device. So I wonder, does that not cause a conflict?
As i say but maybe you don't read :

Using ESP8266 on serial 0 and plug /use USB (who use this serial to) on the same time made :

Allow listening on both domoticz but Esp8266 take the lead, Domoticz who use the USB connection can't send ordre.

I think i have a solution for this (copy Serial 0 to Serial 2) if it works it can't be compatible with nodo shield because we have to change some connection for 433mhz modules.

Martinus

Re: ESP-EASY including SER2NET?

#16 Post by Martinus » 08 Nov 2015, 18:21

Listening to TX pin from arduino should not be an issue, just two receivers connected to one sender.

Sending to RX pin could be an issue. I've seen that the USB chip connects to this pin with a 1k resistor.
You should still be able to pull it down if the USB chip holds this pin high.
I used a reverse diode from ESP to connext TX to RX pin on Arduino.
It works in my case so far...
Maybe add a 100 R resistor in series to limit current.

It would have been better if they had used jumpers to disconnect the onboard USB serial chip from the atmega 2560.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: ESP-EASY including SER2NET?

#17 Post by BertB » 08 Nov 2015, 18:32

@Martinus. Thanks. That's what i meant.

@Deennoo. I tend to read carefully, but your remarks did not point out there is an issue regarding interference and possibly (but not likely) even damaging hardware. Just connecting RX to TX and TX to RX without level shifting is not a good idea. That will damage ESP hardware for sure.

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: ESP-EASY including SER2NET?

#18 Post by Deennoo » 08 Nov 2015, 18:55

Sorry i'm not fluante in english...
Deennoo wrote:
After more test, when ESP is plug, USB can only recieve sending don't works.
BertB wrote:@Deennoo. I tend to read carefully, but your remarks did not point out there is an issue regarding interference and possibly (but not likely) even damaging hardware. Just connecting RX to TX and TX to RX without level shifting is not a good idea. That will damage ESP hardware for sure.
No problème sorry if i hurt you, it was'nt the goal, Excitation by found a way to make RFLink better than competitor....

You're pertinente about level shifting, but more than 6 mounth using ESP8266(sp1/sp12)and upload programme with a simple arduino board without his atmel chip and i Never kill any ESP, lucky am I ? M'y nodemcu will arrive tomorrow...
Martinus wrote:Sending to RX pin could be an issue. I've seen that the USB chip connects to this pin with a 1k resistor.
That the trick on my case it don'tworks
Martinus wrote: You should still be able to pull it down if the USB chip holds this pin high.
I used a reverse diode from ESP to connext TX to RX pin on Arduino.
It works in my case so far...
Maybe add a 100 R resistor in series to limit current.

It would have been better if they had used jumpers to disconnect the onboard USB serial chip from the atmega 2560.
Do you mean that you can send order from a domoticz connect to the Esp and from another connect to USB using the same RFLink ?

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: ESP-EASY including SER2NET?

#19 Post by BertB » 08 Nov 2015, 23:00

Deennoo wrote: You're pertinente about level shifting, but more than 6 mounth using ESP8266(sp1/sp12)and upload programme with a simple arduino board without his atmel chip and i Never kill any ESP, lucky am I ? M'y nodemcu will arrive tomorrow...
I have heard this from more people, but the pins of the ESP8266 are simply not 5 volt tolerant. I would say, you are lucky :-)
Deennoo wrote: Do you mean that you can send order from a domoticz connect to the Esp and from another connect to USB using the same RFLink ?
Not really. Point is that it is not possible to simply tie two TX lines together, because the RS232 protocol does not support that, nor does the hardware.
It takes a bit to far to discuss the arduino hardware here, but if you take a look at the schematics you can see that serial 0 of the Arduino Mega 2650 is connected to an ATMEGA 8 for programming and USB support. In the RX and TX lines between the two is a resistor of 1k. (The Arduino Uno has the same kind of setup.) If you connect an ESP to Serial 0 of the Mega2560, the resistor of 1 k in the tx line of the ATMEGA 8 prevents from short circuiting the ESP TX line, but it also prevents the correct transfer of bits from the 8 to the 2650. In this case the ESP TX dominates.

I hope my explanation is a bit clear. :?

Deennoo
Normal user
Posts: 158
Joined: 07 Sep 2015, 13:03

Re: ESP-EASY including SER2NET?

#20 Post by Deennoo » 13 Nov 2015, 08:38

)Crystal Clear !

Made some advanced test with R42 on ESP01

First got subclient error when compiling (using lib provid with R39), must disable all MQTT entrie.

As Martinus says this not stable enough, and a dedicaced sketch for EasyESP and Ser2net must be set.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests