Problem with Ser2Net ....

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
drnicolas
Normal user
Posts: 13
Joined: 25 Jul 2021, 17:15

Problem with Ser2Net ....

#1 Post by drnicolas » 28 Jul 2021, 08:19

I am having problems with the ser2net component and find the naming confusing
Seems. that I also do not have the same screen as in the docs stated.
Seee the attached picture.
I am using a Wemos D1 mini

1. I find the naming convention confusing . D9 <- TX. Does that mean, it is the pin with "RX" and a signal coming from TX-line of my IR-TTL read head?
2. Using Serial 0 - do I have to activate or de-activate Serial port debugging?
3. The wiki says something of debugging with telnet. How exactly does this work?
4. What's behind the "event processing " setting?
5. And whats behind "single eent "setting?
6. The wiki uses port 23, I left the default setting 1234 - correct?
Attachments
ser2net.PNG
ser2net.PNG (27.49 KiB) Viewed 1384 times

TD-er
Core team member
Posts: 5373
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Problem with Ser2Net ....

#2 Post by TD-er » 28 Jul 2021, 10:31

1. I find the naming convention confusing . D9 <- TX. Does that mean, it is the pin with "RX" and a signal coming from TX-line of my IR-TTL read head?
Yep, the TX signal of the sensor is connected to GPIO-3 (D9).
Thus the pin on the ESP is then the RX.
I tried to make it as descriptive as possible, with on the left the ESP pins and on the right the function of the pins on the device.
2. Using Serial 0 - do I have to activate or de-activate Serial port debugging?
Serial 0 is the serial port, which can be connected to 2 different pin sets on the ESP8266.
- Gpio 1/3 (default)
- GPIO 13/15 (called Serial 0 swapped)

Regardless of which pin set is used, it is still Serial0.
Logs (when enabled) will be sent to Serial0.
So if you leave logs enabled (both "Use serial" checked in tools -> Advanced and log level of serial set to other than 0) the logs will also be sent to the connected device.
3. The wiki says something of debugging with telnet. How exactly does this work?
The ESP will start a service on the port you set.
Using a tool like telnet (e.g. using a tool like "Putty") you can connect to the ESP on that port.
This will then show all data received from the serial port and characters you type into it will be sent to the serial port.
4. What's behind the "event processing " setting?
This mainly has to do with support for the RFlink device.
It will change the generated events based on whether it is received from a RFLink device.
Events will be handled in the rules.
5. And whats behind "single eent "setting?
On new values received a task will generate events.
Typically you have an event per task value (e.g. BME280 will output temp/hum/pressure).
With "Single event with all values" you get a single event per task, with all task values.
See: https://espeasy.readthedocs.io/en/lates ... all-values

If you only have a single task value, it effectively does not change the number of events generated, but the event "name" will be changed. See the link to the documentation I gave.
6. The wiki uses port 23, I left the default setting 1234 - correct?
Port 23 is the default telnet port.
You can use whichever port you like, as long as it is not yet used on that device (e.g. port 80 is already used for the web server)
You should not open it to the internet, but just to give another argument to use a port > 1024.
Port numbers below port 1024 are considered to be "privileged" ports. For example; In Linux you cannot create a user process claiming a port below 1024.
Also a lot of ISPs block ports below port 1024.
This all suggests to use a port > 1024, which is the suggested default of 1234.

So that's a lot of text to tell you "you can leave it at default" :)

drnicolas
Normal user
Posts: 13
Joined: 25 Jul 2021, 17:15

Re: Problem with Ser2Net ....

#3 Post by drnicolas » 29 Jul 2021, 07:52

Thank you for your answer.
I am still struggling to read my power meter (type ED300L, sending SML data)

This worked partially:
- switching the Ser2Net from Hardware serial0 to Softserial, using the same pin GPIO3/D9 as the RX ping 9600/8N1 and port 23 gave my some data inside iobroker which looks fine
- with this setting I still get error messages in the "log Ser2Net: Buffer overflow. Data discarded". Nevertheless, after a few iterations it says data send!.
See the log attached.

Code: Select all

601529: WiFi : Set TX power to 12dBm sensitivity: -69dBm RSSI: -61dBm
601633: WiFi : Set TX power to 11dBm sensitivity: -69dBm RSSI: -60dBm
601734: WiFi : Set TX power to  9dBm sensitivity: -69dBm RSSI: -58dBm
601940: WiFi : Set TX power to 10dBm sensitivity: -69dBm RSSI: -59dBm
602357: WiFi : Set TX power to 11dBm sensitivity: -69dBm RSSI: -60dBm
604023: MQTT : K2-Power/testcounter/Time 0.00
604072: EVENT: testcounter#Count=0.00
604100: EVENT: testcounter#Count=0.00 is ingnored. File rules/testcounter/count not found.
604100: EVENT: testcounter#Count=0.00 Processing time:28 milliSeconds
604169: WiFi : Scan finished, found: 3
604170: WiFi : Scan result: FB7390-K2 BC:05:43:83:DD:90 Ch:6 (-56dBm) WPA/WPA2/PSK
604171: WiFi : Scan result: kroe2 Gast BE:05:43:83:DD:90 Ch:6 (-55dBm) open
604172: WiFi : Scan result: devolo-K2 F4:06:8D:45:68:01 Ch:11 (-80dBm) WPA2/PSK
604176: EVENT: testcounter#Total=0.00
604204: EVENT: testcounter#Total=0.00 is ingnored. File rules/testcounter/total not found.
604205: EVENT: testcounter#Total=0.00 Processing time:29 milliSeconds
604272: EVENT: testcounter#Time=0.00
604299: EVENT: testcounter#Time=0.00 is ingnored. File rules/testcounter/time not found.
604300: EVENT: testcounter#Time=0.00 Processing time:28 milliSeconds
606732: Ser2Net   : Client connected!
607212: Ser2Net   : data send!
608731: Ser2Net   : Error: Buffer overflow, discarded input.
608731: Ser2Net   : Error: Buffer overflow, discarded input.
608731: Ser2Net   : Error: Buffer overflow, discarded input.
608731: Ser2Net   : Error: Buffer overflow, discarded input.
608731: Ser2Net   : Error: Buffer overflow, discarded input.
608732: Ser2Net   : Error: Buffer overflow, discarded input.
608732: Ser2Net   : Error: Buffer overflow, discarded input.
608732: Ser2Net   : Error: Buffer overflow, discarded input.
608732: Ser2Net   : Error: Buffer overflow, discarded input.
608733: Ser2Net   : Error: Buffer overflow, discarded input.
608733: Ser2Net   : Error: Buffer overflow, discarded input.
608733: Ser2Net   : Error: Buffer overflow, discarded input.
608733: Ser2Net   : Error: Buffer overflow, discarded input.
609161: Ser2Net   : data send!
609618: WiFi : Set TX power to 10dBm sensitivity: -69dBm RSSI: -59dBm
Nevertheless, in iobroker the SML data cannot be decoded, but looks for me fine

- Switching back to HWserial0 and D9 as RX, I see no messages about data being sent and also in iobroker silence. Why this?
Looging via serial is disabled and log level for serial is none! Also Port is still 23 and event processing set to none

Can you help me?

TD-er
Core team member
Posts: 5373
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Problem with Ser2Net ....

#4 Post by TD-er » 29 Jul 2021, 14:28

Are you sure the serial log and "Use serial" on tools->Advanced page are disabled?
SW serial is not to be adviced on "chatty" devices, which send often and/or log messages.

drnicolas
Normal user
Posts: 13
Joined: 25 Jul 2021, 17:15

Re: Problem with Ser2Net ....

#5 Post by drnicolas » 29 Jul 2021, 14:35

I think yes.
On advanced page "Enable serial port" is DE_ACTIVATED.
Serial Log is NONE

Hope, that is all

TD-er
Core team member
Posts: 5373
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Problem with Ser2Net ....

#6 Post by TD-er » 29 Jul 2021, 16:49

Most boards have an USB to serial chip on board which is also connected to pins 1 & 3.
So it is possible this affects the signal you receive from your device.
For example it may could be that the device you use needs a stronger pull-up resistor?
So if you test it on some other pins using SW serial, keep in mind which pins already have a pull-up resistor (or pull-down) like GPIO 0, 2 and 15.

drnicolas
Normal user
Posts: 13
Joined: 25 Jul 2021, 17:15

Re: Problem with Ser2Net ....

#7 Post by drnicolas » 01 Aug 2021, 19:43

Good evening.
I still have problems with my setup.

Using Software Serial and D3 as the receive pin sends received data over via tcp . the result looks more or less fine for me, nevertheless the data cannot be decodes.

So, partial success using SoftSerial.
I can also see the bit spikes on my oscilloscope.

At the moment, I switch over to HW Serial , I get no data ouput on TCP and also my oscilloscope cannot see data bits anymore.
Keep in mind! SAME PIN!

TD-er
Core team member
Posts: 5373
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Problem with Ser2Net ....

#8 Post by TD-er » 01 Aug 2021, 21:41

Could it be that the internal pull-up resistor state may have changed between those two tests?

drnicolas
Normal user
Posts: 13
Joined: 25 Jul 2021, 17:15

Re: Problem with Ser2Net ....

#9 Post by drnicolas » 02 Aug 2021, 10:13

Funny, but I did not find any postings of somebody reafing serial data from the HWSerial0 . Olny sending which should be possible via HWSer0 and 1

Also, I did not find any hints if there is something special to consider when using HS0 for read

drnicolas
Normal user
Posts: 13
Joined: 25 Jul 2021, 17:15

Re: Problem with Ser2Net ....

#10 Post by drnicolas » 02 Aug 2021, 10:22

Funny, but I did not find any postings of somebody reafing serial data from the HWSerial0 . Olny sending which should be possible via HWSer0 and 1

Also, I did not find any hints if there is something special to consider when using HS0 for read

TD-er
Core team member
Posts: 5373
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Problem with Ser2Net ....

#11 Post by TD-er » 02 Aug 2021, 10:42

HW serial 0 can be used on 2 pins:
- 1&3 -> the default pins, also connected to the USB to serial converter if present.
- 13 & 15 -> Called "Serial 0 swapped". Pay attention to GPIO-15 as it needs to have a pull-down resistor active during boot.

Serial 0 swapped needs a PNP transistor or else data received from a device during boot may cause boot issues on the ESP.
But I think it is one of the better options to use this 'swapped' version as you're then sure no other parts from the USB to serial chip may interfere.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 10 guests