Modemmanager & 4g HAT communication over UART

@FransvanHoogstraten. I can do that for you. Can you please enable support access to the test device I used earlier?

@aleksander0m, thanks a lot for jumping in here :smiley:

Ah, it is actually still enabled (I used a non-support account to check earlier on). Just let me know and I can handle this.

Sure go ahead! @majorz

No need, the udev rules are read line by line, and the 3 lines should be fine.

Run this to list tags in the device:
udevadm info -p /sys/devices/platform/soc/3f201000.serial/tty/ttyAMA0

And actually… maybe the correct rule is this one (with the longer devpath). I’m not very used to tagging non usb devices…

ACTION!="add|change|move|bind", GOTO="mm_whitelist_end"
DEVPATH=="/devices/platform/soc/3f201000.serial/tty/ttyAMA0" ENV{ID_MM_DEVICE_PROCESS}="1"
LABEL="mm_whitelist_end"

Thanks, I will try both now.

@aleksander0m, still not working unfortunately.

It needed the full path indeed. Output from udevadm:

root@eb6f6c5:/# udevadm info -p /sys/devices/platform/soc/3f201000.serial/tty/ttyAMA0
P: /devices/platform/soc/3f201000.serial/tty/ttyAMA0
N: ttyAMA0
L: 0
S: serial0
E: DEVPATH=/devices/platform/soc/3f201000.serial/tty/ttyAMA0
E: DEVNAME=/dev/ttyAMA0
E: MAJOR=204
E: MINOR=64
E: SUBSYSTEM=tty
E: USEC_INITIALIZED=5827474
E: ID_MM_CANDIDATE=1
E: ID_MM_DEVICE_PROCESS=1
E: DEVLINKS=/dev/serial0
E: TAGS=:systemd:

And a link with the debug logs from ModemManager:

Yeah I got to this point once, but then couldn’t reproduce it. So in that way, we are making progress! :sweat_smile:

To me it would seem from the logs that MM is not able to send/receive AT commands to the modem

When I use minicom from the container to talk to ttyAMA0 though, I can send AT commands and get a response:

Welcome to minicom 2.7

OPTIONS: I18n                                                                
Compiled on Apr 22 2017, 09:14:19.                                           
Port /dev/ttyAMA0, 13:03:50                                                  
                                                                             
Press CTRL-A Z for help on special keys                                      
                                                                             
AT                                                                           
OK                                                                           
AT+CGMI                                                                      
Quectel                                                                      
                                                                             
OK                                      
AT+CGMR                                 
EC25EFAR06A04M4G                        
                                        
OK

@FransvanHoogstraten I think I misconfigured now the config.json and the device does not boot anymore… I wanted to try out setting a different ID_MM_TTY_BAUDRATE, but probably forgot a quote or something. Can you please reprovision the device? Sorry for the trouble…

I should not have done it through config.json in the first place, but just create the .rules file directly (more suitable for testing)…

Done! I renamed the old config.json and reinstalled the original config.json in the boot partition.

Oh, thanks. I will try out the extra ID_MM_TTY_ options available :smiley:

@FransvanHoogstraten What settings did you use for running minicom in the container? It shows offline when I try running it.

Yeah I can’t get a response from the modem myself right now, weird. Looking into it

Its working again! @majorz

Minicom again stopped working. I am short of ideas at this stage.

@majorz would you be able to share your findings here and with @aleksander0m?

Is MM now picking up the port? Where in the process do things go wrong?

It is the same situation as in the gist link with logs I pasted above. From what I can tell commands are sent, but no response is logged. I tried tweaking ID_MM_TTY_FLOW_CONTROL and ID_MM_TTY_BAUDRATE, but could not make a difference.

Can you give me access to the setup to check that myself?

What is your username on balena-cloud.com ?

I am trying to add you but I get the message that ‘aleksander0m’ is not a valid username there