Yes, we modified it in the two places indicated by Kumikomi, built and installed the modified copy of legato, then in our source code open a reverse SSH tunnel using:
system(“/usr/bin/ssh -p [port] -R 44304:localhost:22 sshtest@[url] -i /home/root/.ssh/id_rsa -I 60 < /dev/ptmx”);
with [port] and [url] replaced obviously by the actual values.
Then from the machine the reverse tunnel is opened on we can connect back to the modem (which has a private IP behind a firewall) using:
ssh root@localhost -p 44304 -i c:\users\sshtest.ssh\id_rsa_sshtest
Which is the scenario we need. However, the Legato produced turns out not to be stable. And as I mentioned, it isn’t the change to legato we made that’s causing the issue since if we build the source code without making any modifications the same thing happens. And strangely the size of the legato.cwe is not the same as what’s in the legato-image directory (i would have assumed it was produced by the same toolset compiled against the same source code).
We tried to isolate in our application what was triggering the rebooting and found that if we stopped using UART flow control it seemed to have an effect (no idea why there would be any dependency) and we thought that had fixed it but all it did is increase the time the units would run before rebooting. So this is obviously not a stable thing to be doing. Why this shouldn’t work (and why the compiled file size is different) I have no idea, don’t know if you have any ideas. I suspect Sierra could answer easily but unfortunately they don’t engage on this forum. And they don’t train their distributors near enough to be much help either, at least not in our experience
Maybe we’re doing something wrong with our UART programming:
uart0_fd = le_tty_Open("/dev/ttyHS0", O_RDWR | O_NOCTTY | O_NDELAY);
if (uart0_fd <0)
{
LE_ERROR("uart not opened");
return;
}
ttyInRatePtr = LE_TTY_SPEED_115200;
res = le_tty_SetBaudRate(uart0_fd, ttyInRatePtr);
if (res != LE_OK)
LE_ERROR("can't set baud rate");
// *************** with SMACK switched off HW flow control causes resetting for some reason
res = le_tty_SetFlowControl(uart0_fd,LE_TTY_FLOW_CONTROL_HARDWARE );
if (res != LE_OK)
LE_ERROR("can't set flow control %d",res);
res = le_tty_SetFraming(uart0_fd,'N',8,1 );
if (res != LE_OK)
LE_ERROR("can't set framing %d",res);
res = le_tty_SetRaw(uart0_fd,1,1 );
if (res != LE_OK)
LE_ERROR("can't set raw %d",res);