Serial-wifi bridge

Hello,

I am very new to openWrt and have some problems with my project. I have two 8devices Jalapeno routers, I installed the firmware and set up a wifi bridge, like in the following link described: https://openwrt.org/docs/guide-user/network/wifi/relay_configuration

One Jalapeno is connected to a laptop and one is connected to a PC, everything seems to work as I can ping all devices from each other.

I have problems to set up a serial-to-network configuration. I would like to send data via the serial interface from the laptop to the Jalapeno and receive it on the PC also via the serial interface. And also back from the PC to the laptop.

I tried to set up the ser2net and added following line to the /etc/ser2net.config file:
2002:raw:600:dev/ttyMSM0:115200 8DATABITS NONE 1STOPBIT

I can send data via raw session with PuTTY to the Jalapeno and receive it on the laptop via the serial interface. I can't send data from the laptop to the other Jalapeno/PC.

I also tried to use socat, but didn't have any success.

Can some one help me please or point me in the right direction? I am not sure if I need both, ser2net and socat or if one package can do the task.

Thank you!

While I don't quite follow into the finer details of your description (the serial wifi bridge part), https://openwrt.org/docs/guide-user/network/wifi/atheroswds would be more reliable on the wireless side and hiding multiple devices behind a "client bridge".

1 Like

Yes you have to use WDS or mesh to have the equivalent of a cable joining networks on both sides with the same subnet. Relayd is a kludgey thing that should be considered only as the last resort.

Can you make another diagram that shows the serial connections?

1 Like

Thank you for your replies and sorry if my description is not so clear!

The Jalapeno has a UART interface, the serial data should just get passed through to the other side, here is another diagram:

Sorry if the IP addresses made it more complicated, the IP address isn't important, it doesn't need to be the same subnet on both side, I thought it might be easier this way.

I can ping each device/IP from each other, so I thought the ethernet/wifi bridge is configured correct.

I have problems setting up the serial-to-network part.

The UART serial interface on your APs are almost certainly local - meaning an interface between your computer and the actual device itself and its operation. It is not designed to act as a bridge to be able to run serial between two random devices.

What you probably need is something called a serial port server (presumably a pair of them, but depends on what you are trying to do... something like this would do the trick.

May I ask what it is that you are trying to achieve by connecting the two computers to each other with serial that you can't do with ethernet? Or what the serial connection is actually intended to do?

2 Likes

???

As @psherman noted, this is likely not the case.

2 Likes

Perhaps this was supposed to work out-of-the-box on the original firmware. But this requires specific software and configuration under OpenWrt.

I guess you need to look for serial over ip solution, e.g. http://www.lowlevel.cz/log/cats/english/Socat%20and%20serial%20port%20over%20TCP-IP.html

Matti

1 Like

Thank you everyone for your replies.

I managed to use PuTTY on my PC to send data via the serial interface to Jalapeno 1 and receive the data from Jalapeno 2 via the serial interface on my laptop.

The goal is to replace the PC with a microcontroller board and beeing able to communicate with the microcontroller via serial interface while there is no wired connection to the microcontroller from the laptop. The wifi bridge is necessary because there will be ethernet data be transferred from other devices.

I added following line in /etc/ser2net.conf and restarted ser2net:
2002:raw:600:dev/ttyMSM0:115200 8DATABITS NONE 1STOPBIT

and executed following command on the AP Jalapeno:
socat /dev/ttyMSM0 tcp:192.168.121.82:2002 &

Thanks again for your help.

1 Like