FX30s - Using UART1 & 2 in legato app

Hi everyone !

I am a new user of the modem FX30s and the development platform legato.
As an introduction, I already successfuly experiment some basics applications like HelloWorld or blinking debug led with timers.
But now I would like to develop an application which use UART1 & 2. My project consist in developping the software who spy the AT command communication between a datalogger and the modem and send some of these on an IOT Lorawan card (UART2).

Actually I tried a simple echo on uart1 mode rs232 (!MAPUART=15,1). I can builded and installed the application on the FX30 but I can’t launch the app (Application ‘UART_Test1’ is not installed. However when I check with app status, I can see the application with the state [stopped]. My software is the same as https://forum.legato.io/t/legato-serial-communication-fx30s/3287/3 , I just changed the component.cdef with [rw] /dev/ttyHS0 /dev/ttyHS0.

Secondly, I would like to know if there is a chance to perform AT commands with a legato app because of the requirements of my application.

Best Regards,

Bastien

Hi Bastien,
Please monitor the log by typing “logread -f”

In a separate session, try starting your app:
app start UART_test1

Then you can see the logs why your app isn’t starting.

You can send AT commands from your app if you open /dev/ttyAT

BR,
Chris

Hi Chris,
Thanks for your reply,

I had this log, it seems that the modem can’t find the tty file for HS0 :

Jun 25 09:07:04 fx30s user.err Legato: =ERR= | supervisor[524]/supervisor T=main | app.c GetDevID() 629 | Could not get file info for ‘/dev/ttyHS0’. No such file or directory.
Jun 25 09:07:04 fx30s authpriv.info dropbear[3284]: Exit (root): Disconnect received

BR,
Bastien

Hi Bastien,
I assume you’re running R14.0.4.002.

Can you please check if the ttyHS0 device does indeed exist?

Did you reboot after the mapuart=15,1 command?

BR,
Chris

Hi Chris,

Thanks for your help !
Apparently the problem was my firmware, now it’s work.

I have a last question, Is there a way to communicate to the /dev/ttyHSL1 from the linux shell?
I thought I should use

microcom -s BAUD_RATE /dev/ttyHSL1

on the FX30S but that doesn’t work.

BR,
Bastien

Hi Bastien,
You can try using “echo” or “cat” but I would recommend this only for testing or for a short script.
BR,
Chris