Hi all !
I have an issue hope everybody help me !
I want to send and read data from Serial devices using UART(RS232).
I known ser2net may be do it but i don't known how to use it ???
Please help me !!!
Thanks all !!
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
A Google search for "ser2net raspberry" quickly found these 3 apparently relevant links -
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
I'm already read all link but i still don't understand how can i use GPIO 14 and GPIO 15 for my COM Port ? in three link you gave, it use USB-RS232 cable, but i want to connect with UART Pin .DeeJay wrote:A Google search for "ser2net raspberry" quickly found these 3 apparently relevant links -
I did success with echo a character or string from terminal in Windows using GPIO 14 and GPIO 15.
Please guide me with ser2net !!
Thanks sir so much !!!
Re: [Help] How to using Ser2net to send and read data
I haven't done it, but is there any reason why you could not use the built-in GPIO uart device ( /dev/ttyAMA0 ) as the port to be controlled by the ser2net.conf file? (You will need to remove the default association with the system console first - that is well documented elsewhere.)
Please bear in mind that rs232 signal levels are NOT simple 0v and 3v levels as produced by the RPi GPIO pins - you will need an external level convertor before you can safely connect to another rs232 device.
Please bear in mind that rs232 signal levels are NOT simple 0v and 3v levels as produced by the RPi GPIO pins - you will need an external level convertor before you can safely connect to another rs232 device.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
Sir, I'm using MAX3232 for level convertor and I sure it still working !!DeeJay wrote:I haven't done it, but is there any reason why you could not use the built-in GPIO uart device ( /dev/ttyAMA0 ) as the port to be controlled by the ser2net.conf file? (You will need to remove the default association with the system console first - that is well documented elsewhere.)
Please bear in mind that rs232 signal levels are NOT simple 0v and 3v levels as produced by the RPi GPIO pins - you will need an external level convertor before you can safely connect to another rs232 device.
I can't use UART pin with Ser2net, sir ?
If i can't using Ser2net for my application, How can you guide me send data from RS232 to Webserver (Show a string from UART over webpage) ???
I really thanks you, sir !
-
- Posts: 7565
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: [Help] How to using Ser2net to send and read data
Your post is a bit vague. Not clear what your are trying to do. No information about how you are set up and what you have tried....lee_trieu wrote:Hi all !
I have an issue hope everybody help me !
I want to send and read data from Serial devices using UART(RS232).
I known ser2net may be do it but i don't known how to use it ???
Please help me !!!
Thanks all !!
To use ser2net here is what you need to do:
1. Configure your router to reserve an IP address for your RPi so it always gets the same IP address.
-OR- configure the RPi for a static IP address but the above is easier.
2. Configure your console to work as a generic serial port by editing /etc/inittab and /boot/cmdline.txt
3. Install ser2net: sudo apt-get install ser2net
4. Configure /etc/ser2net.conf (There are instructions of how to configure ser2net contained in the ser2net.conf file)
I have step by step examples of all the above on my web page:
http://home.budget.net/~klricks/Comp/RPi/Serial.html
If you are still having trouble then post your ser2net config file here
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
Thanks you so much !!klricks wrote:Your post is a bit vague. Not clear what your are trying to do. No information about how you are set up and what you have tried....lee_trieu wrote:Hi all !
I have an issue hope everybody help me !
I want to send and read data from Serial devices using UART(RS232).
I known ser2net may be do it but i don't known how to use it ???
Please help me !!!
Thanks all !!
To use ser2net here is what you need to do:
1. Configure your router to reserve an IP address for your RPi so it always gets the same IP address.
-OR- configure the RPi for a static IP address but the above is easier.
2. Configure your console to work as a generic serial port by editing /etc/inittab and /boot/cmdline.txt
3. Install ser2net: sudo apt-get install ser2net
4. Configure /etc/ser2net.conf (There are instructions of how to configure ser2net contained in the ser2net.conf file)
I have step by step examples of all the above on my web page:
http://home.budget.net/~klricks/Comp/RPi/Serial.html
If you are still having trouble then post your ser2net config file here
I onlly want to make a "Serial to IP Converters" like this

Ser2net will do it, sir ???
-
- Posts: 7565
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: [Help] How to using Ser2net to send and read data
Yes the RPi with Max3232 converter module and ser2net software can do the same.
(Make sure the MAX3232 module is powered by the 3V3 and not 5V)
The RPi can also do serial to IP over WIFI network instead of wired if you put a WIFI adapter on the RPi.
FYI- Homeseer is the company selling the $200.00 Raspberry Pi
http://store.homeseer.com/store/Default.aspx
(Make sure the MAX3232 module is powered by the 3V3 and not 5V)
The RPi can also do serial to IP over WIFI network instead of wired if you put a WIFI adapter on the RPi.
FYI- Homeseer is the company selling the $200.00 Raspberry Pi
http://store.homeseer.com/store/Default.aspx
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
Hi sir ! I did like you on this linkklricks wrote:Yes the RPi with Max3232 converter module and ser2net software can do the same.
(Make sure the MAX3232 module is powered by the 3V3 and not 5V)
The RPi can also do serial to IP over WIFI network instead of wired if you put a WIFI adapter on the RPi.
FYI- Homeseer is the company selling the $200.00 Raspberry Pi
http://store.homeseer.com/store/Default.aspx
http://home.budget.net/~klricks/Comp/RPi/Serial.html
and this is my config file: /etc/ser2net.conf
Code: Select all
BANNER:banner:\r\nser2net port \p device \d [\s] (Debian GNU/Linux)\r\n\r\n
# IP address must be reserved on router so RPi always gets the same IP.
192.168.1.108,2000:raw:0:/dev/ttyAMA0:9600 8DATABITS NONE 1STOPBIT banner
#2000:telnet:600:/dev/ttyS0:9600 8DATABITS NONE 1STOPBIT banner
#2001:telnet:600:/dev/ttyS1:9600 8DATABITS NONE 1STOPBIT banner
#3000:telnet:600:/dev/ttyS0:19200 8DATABITS NONE 1STOPBIT banner
#3001:telnet:600:/dev/ttyS1:19200 8DATABITS NONE 1STOPBIT banner
Browser show "Port already in use"
I did it wrong, sir ??
-
- Posts: 7565
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: [Help] How to using Ser2net to send and read data
I get that error only when trying to view the same IP:port with 2 different applications at the same time. I was viewing with Realterm and could not open the same port in my browser (Firefox on Win8.1). When I closed down Realterm then it would work in the browser.lee_trieu wrote:Hi sir ! I did like you on this linkklricks wrote:Yes the RPi with Max3232 converter module and ser2net software can do the same.
(Make sure the MAX3232 module is powered by the 3V3 and not 5V)
The RPi can also do serial to IP over WIFI network instead of wired if you put a WIFI adapter on the RPi.
FYI- Homeseer is the company selling the $200.00 Raspberry Pi
http://store.homeseer.com/store/Default.aspx
http://home.budget.net/~klricks/Comp/RPi/Serial.html
and this is my config file: /etc/ser2net.confbut when i using google chrome and enter addreess: 192.168.1.108:2000Code: Select all
BANNER:banner:\r\nser2net port \p device \d [\s] (Debian GNU/Linux)\r\n\r\n # IP address must be reserved on router so RPi always gets the same IP. 192.168.1.108,2000:raw:0:/dev/ttyAMA0:9600 8DATABITS NONE 1STOPBIT banner #2000:telnet:600:/dev/ttyS0:9600 8DATABITS NONE 1STOPBIT banner #2001:telnet:600:/dev/ttyS1:9600 8DATABITS NONE 1STOPBIT banner #3000:telnet:600:/dev/ttyS0:19200 8DATABITS NONE 1STOPBIT banner #3001:telnet:600:/dev/ttyS1:19200 8DATABITS NONE 1STOPBIT banner
Browser show "Port already in use"
I did it wrong, sir ??
The port could be used for something else. Try a different port. 2001 or 3000 etc.
When I use Ser2net running on my Linux desktop (Fedora 20) I had to use a config line like this:
2000:raw:0:/dev/ttyAMA0:9600 8DATABITS NONE 1STOPBIT banner
(It would not work with the full IP address)
I will have to get my RPi back running ser2net and see if something has changed.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
Sir !! Can you give me a picture when ser2net working?? I don't know how is it?klricks wrote:
I get that error only when trying to view the same IP:port with 2 different applications at the same time. I was viewing with Realterm and could not open the same port in my browser (Firefox on Win8.1). When I closed down Realterm then it would work in the browser.
The port could be used for something else. Try a different port. 2001 or 3000 etc.
When I use Ser2net running on my Linux desktop (Fedora 20) I had to use a config line like this:
2000:raw:0:/dev/ttyAMA0:9600 8DATABITS NONE 1STOPBIT banner
(It would not work with the full IP address)
I will have to get my RPi back running ser2net and see if something has changed.
When you open it on Terminal and on Web browser?
Thanks you so much, sir !
-
- Posts: 7565
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: [Help] How to using Ser2net to send and read data
The output shown in the Realterm terminal program is from a weather station datalogger.
The datalogger outputs a new line of data 1 per second.
Note this is not using a RPi. The datalogger is connected to my Fedora box running ser2net. Then viewed over the network on a Win8.1 computer.
Don't have a RPi running at the moment but it works just the same.
Running on web browser is no different looks very much the same:

The datalogger outputs a new line of data 1 per second.
Note this is not using a RPi. The datalogger is connected to my Fedora box running ser2net. Then viewed over the network on a Win8.1 computer.
Don't have a RPi running at the moment but it works just the same.
Running on web browser is no different looks very much the same:

Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
Thanks Sir !klricks wrote:The output shown in the Realterm terminal program is from a weather station datalogger.
The datalogger outputs a new line of data 1 per second.
Note this is not using a RPi. The datalogger is connected to my Fedora box. Then viewed over the network on a Win8.1 computer.
Don't have a RPi running at the moment but it works just the same.
Running on web browser is no different looks very much the same:
Do you have some code for your weather station ,sir???
I don't understand how to send and receive data from COM port with ser2net?
-
- Posts: 7565
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: [Help] How to using Ser2net to send and read data
There is no custom code running at all... only ser2net on server computer and the terminal program on remote computer.
The datalogger is all self contained and just connected to the server computer via an RS232 cable.
It's just a serial device. Could be a GPS or any other serial device...... doesn't matter...
ser2net is capturing data from a com port on the server computer (RPi).
Then data from com port is converted to network IP:port and sent out on the local network. Don't confuse com ports with IP ports......
Any computer connected to the network can access the data at the IP:port
At the moment I am not using any com ports at the remote computer...... However the Realterm program can echo the data stream to a virtual for physical com port if you wish. This is useful if you want to run software that expects get data from a com port. The software will get data from the com port and not know the serial data source is really connected to a different computer over the network.
You can also use other software to create virtual com ports on your PC such as comOcom or COM2TCP
I'm sure of course you realize that the serial device must be actively outputting data else you won't see anything from ser2net.
The datalogger is all self contained and just connected to the server computer via an RS232 cable.
It's just a serial device. Could be a GPS or any other serial device...... doesn't matter...
ser2net is capturing data from a com port on the server computer (RPi).
Then data from com port is converted to network IP:port and sent out on the local network. Don't confuse com ports with IP ports......
Any computer connected to the network can access the data at the IP:port
At the moment I am not using any com ports at the remote computer...... However the Realterm program can echo the data stream to a virtual for physical com port if you wish. This is useful if you want to run software that expects get data from a com port. The software will get data from the com port and not know the serial data source is really connected to a different computer over the network.
You can also use other software to create virtual com ports on your PC such as comOcom or COM2TCP
I'm sure of course you realize that the serial device must be actively outputting data else you won't see anything from ser2net.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
Thanks you so much !!klricks wrote:There is no custom code running at all... only ser2net on server computer and the terminal program on remote computer.
The datalogger is all self contained and just connected to the server computer via an RS232 cable.
It's just a serial device. Could be a GPS or any other serial device...... doesn't matter...
ser2net is capturing data from a com port on the server computer (RPi).
Then data from com port is converted to network IP:port and sent out on the local network. Don't confuse com ports with IP ports......
Any computer connected to the network can access the data at the IP:port
At the moment I am not using any com ports at the remote computer...... However the Realterm program can echo the data stream to a virtual for physical com port if you wish. This is useful if you want to run software that expects get data from a com port. The software will get data from the com port and not know the serial data source is really connected to a different computer over the network.
You can also use other software to create virtual com ports on your PC such as comOcom or COM2TCP
I'm sure of course you realize that the serial device must be actively outputting data else you won't see anything from ser2net.
it still no working for me

-
- Posts: 7565
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: [Help] How to using Ser2net to send and read data
Try swapping TX & RX Between GPIO and the RS232 module.
Connecting through a browser is probably not the best way? I never tried that until you mentioned that.
For me the browser continuously shows status as ...Connecting... but the data does come through. It does take several seconds to start seeing the data for me.
I haven't tried bi-directional communication yet in a browser (only receive) but I will try that when I get a chance.
Connecting through a browser is probably not the best way? I never tried that until you mentioned that.
For me the browser continuously shows status as ...Connecting... but the data does come through. It does take several seconds to start seeing the data for me.
I haven't tried bi-directional communication yet in a browser (only receive) but I will try that when I get a chance.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
Sir ! I was swap it but it still not working !klricks wrote:Try swapping TX & RX Between GPIO and the RS232 module.




Realterm display connected but no data return




Large image:https://dl.dropboxusercontent.com/u/23155150/eor.png
-
- Posts: 7565
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: [Help] How to using Ser2net to send and read data
Does the baud rate and other parameters of the serial device match what you have put in the ser2net.conf?
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
Yes i do ! I'm sure all of it were mathed !klricks wrote:Does the baud rate and other parameters of the serial device match what you have put in the ser2net.conf?
Sir, this is my configure file:

Large image: https://dl.dropboxusercontent.com/u/231 ... aurate.png
-
- Posts: 7565
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: [Help] How to using Ser2net to send and read data
Try this in ser2net.conf:
3211:raw:0:/dev/ttyAMA0:115200 8DATABITS NONE 1STOPBIT banner
3211:raw:0:/dev/ttyAMA0:115200 8DATABITS NONE 1STOPBIT banner
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
Sory sir ! I'm sad to say that it still not workingklricks wrote:Try this in ser2net.conf:
3211:raw:0:/dev/ttyAMA0:115200 8DATABITS NONE 1STOPBIT banner





Can you guide me how to test UART ??? like echo a char, please sir !
I now i can't Puttty with UART pin



Thank you so much, sir !!!
-
- Posts: 7565
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: [Help] How to using Ser2net to send and read data
Note that the Hercules serial terminal / monitor needs to be configured for NO FLOW control (no RTS & CTS).
If flow control can't be turned off then you would need buy or make a Null handshake adapter:
http://www.lammertbies.nl/comm/info/RS- ... modem.html
Refer to the Null modem with loop back handshaking section. Note the handshaking loopback only needs to be on the serial terminal side.
Loopback tests:
Stop Ser2net with this command:
/etc/init.d/ser2net stop
Remove your Max3232 adapter and short the GPIO TX & RX together with a jumper wire.
Run a terminal program such as minicom or Cutecom (GUI) and type characters. Typed characters should echo with jumper on and not echo with jumper off.
Install the Max3232 adapter and short pin 2 & 3 on the 'D' connector.
Repeat echo test.
(If the adapter has LED's for TX & RX they should blink with data as well)
You could also test by connecting a serial port of a computer to the RPi via Max3232 and run Realterm, and type characters back and forth between RPi and computer.
Also try connecting your Hercules serial terminal monitor to the PC.
If flow control can't be turned off then you would need buy or make a Null handshake adapter:
http://www.lammertbies.nl/comm/info/RS- ... modem.html
Refer to the Null modem with loop back handshaking section. Note the handshaking loopback only needs to be on the serial terminal side.
Loopback tests:
Stop Ser2net with this command:
/etc/init.d/ser2net stop
Remove your Max3232 adapter and short the GPIO TX & RX together with a jumper wire.
Run a terminal program such as minicom or Cutecom (GUI) and type characters. Typed characters should echo with jumper on and not echo with jumper off.
Install the Max3232 adapter and short pin 2 & 3 on the 'D' connector.
Repeat echo test.
(If the adapter has LED's for TX & RX they should blink with data as well)
You could also test by connecting a serial port of a computer to the RPi via Max3232 and run Realterm, and type characters back and forth between RPi and computer.
Also try connecting your Hercules serial terminal monitor to the PC.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
Sir ! I think it working now...klricks wrote:Note that the Hercules serial terminal / monitor needs to be configured for NO FLOW control (no RTS & CTS).
If flow control can't be turned off then you would need buy or make a Null handshake adapter:
http://www.lammertbies.nl/comm/info/RS- ... modem.html
Refer to the Null modem with loop back handshaking section. Note the handshaking loopback only needs to be on the serial terminal side.
Loopback tests:
Stop Ser2net with this command:
/etc/init.d/ser2net stop
Remove your Max3232 adapter and short the GPIO TX & RX together with a jumper wire.
Run a terminal program such as minicom or Cutecom (GUI) and type characters. Typed characters should echo with jumper on and not echo with jumper off.
Install the Max3232 adapter and short pin 2 & 3 on the 'D' connector.
Repeat echo test.
(If the adapter has LED's for TX & RX they should blink with data as well)
You could also test by connecting a serial port of a computer to the RPi via Max3232 and run Realterm, and type characters back and forth between RPi and computer.
Also try connecting your Hercules serial terminal monitor to the PC.
I'm really thank sir so much !

Large image: https://dl.dropboxusercontent.com/u/231 ... orking.png
Sir,...but it only working on Realterm. On web browser it don't display






But when i connect on browser the Hercluse Terminal show some thing like that

Large image: https://dl.dropboxusercontent.com/u/23155150/web.png
I don't understand why does it don't working on web browser !!






-
- Posts: 7565
- Joined: Sat Jan 12, 2013 3:01 am
- Location: Grants Pass, OR, USA
- Contact: Website
Re: [Help] How to using Ser2net to send and read data
Please tell what you did to get it working.....
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.
-
- Posts: 23
- Joined: Wed Dec 18, 2013 4:54 am
- Contact: Yahoo Messenger
Re: [Help] How to using Ser2net to send and read data
Sir ! I tried using Msp430 launchpad Dev KIT to connect with my Pi and it working now !klricks wrote:Please tell what you did to get it working.....
I think my RS232 module have problem !
But on browser it can't display anything !! Please give me a idea, sir !
Thanks sir so much !