Web Server over serial port

Hi,
I have an equipment with Ethernet Port, RS485 and RS232. Mainly it is a gateway (Modbus/Unitelway gateway from RS485 and Ethernet or RS232 -
exactly is this instruments : https://www.schneider-electric.com/resources/sites/SCHNEIDER_ELECTRIC/content/live/FAQS/22000/FA22846/en_US/35004734_k01_000_05.pdf
On this gateway runs a Web server for configuring it and in the past, during commissioning, I changed the default IP with an IP gave to me by customer. Now this gateway has been put out of service by customer and
I’m trying to (re)use it. I tried to access it by the IP that I knew and even with the default IP but the gateway doesn’t reply. I read the user manual & I see there non possibility to reset the IP to the default one.
I read that is possible to access the gateway via RS232 (normally within a modem) with the use of PPP protocol (page 36) :

The connection uses the PPP protocol (Point-to-Point Protocol). Thanks to this protocol, once the telephone link has been established the modem link will be
viewed on the application level in the same way as a TCP/IP link

This is the procedure explained in the user manual (page 104) :

1 - Connect a RS 232 crossover cable between a PC COM port and the 9-pin SUB-D port on the ETZ module
2 - Establish the serial connection between the PC and the module
3&4 - Open the Internet browser on your PC : In the “Address” field, type: http://85.16.0.2, then <Enter>
5&6 - Web server access & operations

I have a serial port on my PC (/dev/ttyS0) and I have connetted PC & gateway with a null modem RS232c cable … so point 1 should be OK
Point 2 is the key point …

I read in the net that I need SLIP but it’s not clear what I have to do. I’ve found the following commands :
[LEFT]

slattach -p cslip -s 19200 /dev/ttyS0 &
ifconfig sl0 IP-Pc pointtopoint IP-destination

[/LEFT]

[LEFT]
[/LEFT]
slattach output :


[1] 7691

No errors but I don’t know the meaning/use of the output

ifconfig it’s deprecated and not installed (I can install it from package net-tools-deprecated but I prefer not to do it) & I did not find the equivalent command (maybe it’s ‘ip’).

What next ?

In a situation like what you describe,
I simply do an Internet search for the factory provided password and instructions how to reset your device to default settings.
I’d then use an ethernet (or WiFi) connection to the device and see if the password hadn’t been changed and works.
If you don’t know the IP address of your device, then do a “route show” or similar to display your Default Gateway, for SOHO routers the Default Gateway and the web server address are the same.

If the password doesn’t work,
Then I do the Factory Reset on the device,
Then when it reboots login with the Factory password, this typically takes 20-40 minutes after the device resets and reboots.
If this is a Cable Modem, then the device will also automatically download and install updates from your ISP which can add another 20-90 minutes.

When you login, don’t forget to change the password and write it down somewhere (or save somewhere easy to access like your phone’s cloud storage), and make all desired changes to your setup.

I wouldn’t bother with trying to connect over a serial port, from what you describe the instructions assume you’re able to set up ethernet over serial which common in the MSWindows world, but not automatic in the *NIX world (maybe use Spice?).

HTH,
TSU

Tsu2 thank for your reply.
Just to avoid misunderstanding : the equipment is an industrial protocol gateway (it manages Modbus/Unitelway protocols from/to RS485 and Ethernet or RS232) and has (+/-) nothing in common with SOHO router/gateway.
The only way to access it & configure it is via the integrated web server. The web server runs on ethernet port (but I don’t know the IP) or via RS232 (the IP protocol is transported / encapsulated within PPP protocol).
There is no way to reset the equipment with default parameters (also IP address) so, if I can’t find is IP address, I can’t use it.
It remains the possibility to reach the web server using RS232 (because it has always the same IP & no one can change it) … and this is what I’m trying to do.

Ciao,
Max

Hi
Maybe open the box and might find a reset button or jumper to short?

Else look at using minicom (you would need to add your user to dialout group), this is assuming it was configured? See if can send at commands to the box…

Hi Malcolm,
I opened the box but no luck here … no jumper / reset button :frowning:

I could use minicom if only I knew what commands send … if they exists.

I need to access to web server and I think this is only possible through a browser but if you know other ways I’ll be very happy to learn it.
Maybe other possibility : is it possible to find the IP address of a device with some ip / ifconfig / other commands ?

Boy, this a blast from the past…
It’s been a very, very long time since I’ve looked at this kind of communications, it goes back even further than when I configured “ordinary” serial communications in a terminal.

So, at least for me,
A refresher on the PPP protocol, which in this case is <very> different than PPPoE which we’ve seen more recently setting up DSL connections. Today, we have a valuable reference for quickly understanding something new that didn’t exist long ago, Wikipedia…

https://en.wikipedia.org/wiki/Point-to-Point_Protocol

From the above, we understand the PPP architecture layers, how PPP works and that it’s not the same as SLIP.

Top 2 hits from an Internet search for setting up PPP on Linux are the following which combined should enable you to set up…

The following has step by step instructions including plenty of good troubleshooting commands along the way. You’ll probably have to use ip commands instead of ifconfig. Keep in mind where necessary that you’re setting up PPP to support IP (Internet Protocol) and not any of the other possible higher level protocols.

https://www.linuxjournal.com/article/2109

The following is from the ever authoritative tldp project. It’s a lot shorter than the above steps, which of course also means that without the detailed verification and troubleshooting commands might mean greater chances for failure, but if the described steps work, you’ll be set up very quickly

https://www.tldp.org/HOWTO/PPP-HOWTO/manual.html

It also looks like you can set up using Network Manager, more more precisely using the nmcli utility. I don’t find the instructions as easy to follow as the above, so don’t know how easy it’d be to set up successfully. The first link is the instructions, the second is a link to the nmcli MAN pages which is supposed to be your ultimate reference

https://superuser.com/questions/1043141/configuring-a-ppp-device-with-networkmanager-nmcli
https://developer.gnome.org/NetworkManager/stable/NetworkManager.html

Without actually working through the above links, I can’t say for sure what problems you might run into, but IMO the above links should give you a fairly good chance of success.

Once PPP is set up supporting IP, you should be able to connect to a known IP address on the other end. Since networking services probably wouldn’t be available, your network configuration will have to be configured manually but you shouldn’t need any kind of name resolution or gateway addresses, only a valid IP address and subnet mask.

Good Luck,
TSU

Minicom is a terminal application… another blast from the distant past which I haven’t used in a long time.
Shouldn’t be used for what you really want to do… enable web browser support.

TSU

Hi
Use it all the time to talk to RPI’s, play with u-boot :wink:

Well if it’s not configured on the box as a backup, it may be disabled…

@OP, how did you try connecting via ethernet, cross-over ethernet (may no be set to auto negotiate) cable, standard cable, through a hub/switch?

If you run wireshark you may see some broadcast traffic that would indicate the boxes ip address.

Hi,
I’m connected the device with patch cord & switch.
My IP is 172.16.0.1/16 without gateway and I suppose the device IP is 172.16.5.93

I run wireshark and I discovered the culprit (other my ignorance) : the gateway configured inside the device (it’s 172.16.7.250 … and I’ve even know that !!!)
So I changed my IP in 172.16.5.1 and now the device reply to ping and I can see it through FF … but now I’m facing the obsolescence of the product.
Web server starts but some pages (included that for configure IP address) are not replying I suppose because they use a very old version of Java.

Now it’s late to go on but tomorrow, I’ll try within a VM with XP …

Many many many thanks to Malcolm & Tsu2 for their support.

Although possible, I’d wouldn’t expect anyone writing a <little> web server for configuration would use Java.
More than likely it might be using a very old version of Javascript and yes… If old enough the commands might have been deprecated or more likely blocked.

Recommend you be sure you do <not> have script blocking enabled in your web browser.
Only if that doesn’t work, then maybe set up a very old OS of that vintage.

You can also try running a text mode web browser.
If you have a Dev background sufficient to trace and identify errors, you can also launch the Development Tools in any modern web browser.

TSU

Hi,
I agree with you : it’s more likely javascript than java … sorry for my imprecision.
With FF (Opensuse) & Explorer (Win7) most pages are blocked.
I spent to much time for finding the IP that now I think is wiser to use an XP machine just for changing 2 or 3 parameters. In fact with XP I can access to every page and this is more than enough for my purpose.

If I had time to waste (but I’ve not at the moment) I’ll investigate with my starting idea : connect to a web server through serial port … Maybe in a remote future :slight_smile:

Ciao,
Max

Connecting using com ports: use pppd or PuTTY.

For openSUSE: https://software.opensuse.org/search?utf8=✓&baseproject=ALL&q=putty

Manual for PuTTY: http://web.archive.org/web/20120509090742/http://www.plugcomputer.org/plugwiki/index.php/Setting_up_Serial_Console_Under_Linux

Manual for pppd: man pppd

NAME
pppd - Point-to-Point Protocol Daemon

SYNOPSIS
pppd options ]

DESCRIPTION
PPP is the protocol used for establishing internet links over dial-up modems, DSL connections,
and many other types of point-to-point links. The pppd daemon works together with the kernel
PPP driver to establish and maintain a PPP link with another system (called the peer) and to
negotiate Internet Protocol (IP) addresses for each end of the link. Pppd can also authenti-
cate the peer and/or supply authentication information to the peer. PPP can be used with other
network protocols besides IP, but such use is becoming increasingly rare.

Connecting 2 PCs using com ports and a null-modem cable:
At 1st machine issue a command: pppd /dev/ttyS0 115200 local nocrtscts nocdtrcts noxonxoff 192.168.0.1:192.168.0.2 netmask 255.255.255.252 noauth
At 2nd machine issue a command: pppd /dev/ttyS0 115200 local nocrtscts nocdtrcts noxonxoff 192.168.0.2:192.168.0.1 netmask 255.255.255.252 noauth

Null modem
Serial Line Internet Protocol

Thx for the commands, it’s something I’ll be sure to try out the next time I have an opportunity to test and maybe even experiment with as a template,
According to the first link in my prior post though, your second link about SLIP doesn’t apply, the “newer” PPP is supposed to supercede SLIP.

Of course, the null modem cable (or auto negotiating ports) would be required for a direct connection.

TSU