I am new to coding for the C++ & the Legato environment. I have an FX30S-LTE that I need to open a TCP/IP port to listen for incoming connections & then route the data packets to the RS232 port. I am currently opening a PPP session with the attached device (a data logger) but as expected, this is not particularly reliable. Any help in how to code for this to run automatically on start up would be very much appreciated. Thanx
Thanx for your response. I don’t have to have PPP running, it was just a method to open a listening port & establish communication from a computer to the data logger over a private APN. Avoiding the PPP session is ideal.
I’ll give your suggestion a try
When I try to compile & run the code I get the following error: The path ‘/dev/ttyHSL0’ cannot be resolved
Any suggestions?
I have the code as follows:
version: 1.0.0
maxFileSystemBytes: 512K
sandboxed: true
start: manual
executables:
{
iptables -I INPUT -j ACCEPT
app runProc UART_TCP_Server UART_TCP_Server --exe=uart – 6785 /dev/ttyHSL0 115200
uart = ( UART_TCP_ServerComponent )
}
processes:
{
envVars:
{
LE_LOG_LEVEL = DEBUG
}
run:
{
//( uart )
}
maxCoreDumpFileBytes: 512K
maxFileBytes: 512K
}
Feel free to call me an idiot if this is a complete steaming pile of not correct
I did wonder about that & have tried it. I now get the code compiling & can load it into the modem, but I do not have any coms through to the logger. The logger is set to 115200 baud rate. Do I need to change IP Address or Port number anywhere else in one of the included files? Ideally it would work with any IP address issued by the cell network
you can start with USB ECM interface first and see if the app can receive the TCP data.
i.e.
Establish a TCP client connection from PC to 192.168.2.2 on port 5044
My PC gets an IP address from the modems DHCP server, but it will not talk to the logger (I am assuming that TCP packets over the USB connection will also be ported to the UART)
Ihave finally got back to this, my time was taken away by other work. I’m not sure how to run the commands you are talking about. I am running a Windows 7 PC, I suspect you are running a Linux environment of some variation?
It is also worth noting that I have changed the port number to 6785 for our purposes.
Do I need to set this anywhere else? in any of the other code files for example?
I’ll try to sort out a linux machine. I might be able to run it from a USB drive. As I am not familiar with linux, how would I go about running the commands? I assume there is a terminal of some kind?