And in there, there are a bunch of reconnect scripts which you should check and see how to bring the modem up (for example in https://github.com/sixfab/Sixfab_PPP_Installer/blob/master/ppp_installer/reconnect_cellulariot they state that gpio 17 is to bring the modem out of reset and gpio 24 is to power on the modem). You would need to export from userspace for example and set the gpios they use there. But you should really have a schematics for this, otherwise parse the above and see which one do the job.
The modem is now working if I follow these instructions:
Additionally, I can use minicom to connect to the modem on ttyAMA0 and send AT commands & get a response. Super!
Therefore I know that the hardware is working, and the modem is up (no additional GPIO switching is needed).
I would however like the modem to be recognised & controlled by modem manager, from the hostOS (so that connectivity is not controlled from the container, for obvious reasons).
Therefore, is there a way for me to see why modemmanager is not recognising this modem? I am sure it is supported, because if I use the USB cable it is recognised instantly.
(PS: some other forum said I needed to set the following udev rule, which I did. Too bad this didn’t help:)
Hi Frans, based on your previous message, it sounded like the modem was working, if you used their install.sh script. What is not working, or, more precisely, what do you need to debug in modemmanager exactly? Any extra information you can provide would help us get you moving in the right direction. Thanks.
I would like to get a working internet connection on my Raspi3b from the 4G HAT (link in original post) i.c.w. a Quectel EC25-E modem.
The connection should be managed from the HostOS (not the container!), preferably by ModemManager.
Data connection between HAT and Raspi should be via UART (not USB).
Current Status:
Modem is not recognised by ModemManager (mmcli -L returns no modems).
Context:
To double check if all hardware is working, I tried creating PPP connection from container with the script from the HAT manufacturer (port: ttyAMA0). This was successful. Therefore I know all hardware is working, incl UART connection.
To double check if modem is supported by ModemManager, I connected the HAT via external USB cable to the Raspi. The modem is then immediately recognised by MM and connection is established automatically (I have created the correct connection file in system-connections).
Other forum posts (link1, link2, link3) suggest I have to implement certain udev rules for the modem to be recognised over ttyAMA0. I have tried various (via config.json) but nothing worked up until now.
When performing a ModemManager scan (mmcli -S), ModemManager (debug)logs are showing: ModemManager[704]: (tty/ttyAMA0): adding device at sysfs path: /sys/devices/platform/soc/3f201000.serial/tty/ttyAMA0 ModemManager[704]: [filter] (tty/ttyAMA0): port filtered: tty platform driver
My question to you:
How can I find out WHY ModemManager is not recognising my modem on ttyAMA0? And how can I fix it…
ModemManager[704]: [filter] (tty/ttyAMA0): port filtered: tty platform driver
suggests that the port is being filtered by MM and it is not being probed.
The approach of flagging the platform TTY should work. I would also suggest trying a flag the serial platform device, with something like:
Did some testing, but I am getting some really inconsistent results. Its driving me crazy:
I have tried applying the mentioned rule. At first it was being applied (checked with udevadm), currently it is not being applied. No clue what changed. I only rebooted in between.
I have also tried applying the following 2 udev rules at the same time: ACTION=="add", KERNEL=="3f201000.serial", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1" ACTION=="add", KERNEL=="ttyAMA0", ENV{ID_MM_PLATFORM_DRIVER_PROBE}="1"
This helped a little, it made MM pick up on ttyAMA0 once. I saw in the logs that MM actually scanning ttyAMA0 and was sending AT commands to the modem. Sadly it dit not recognise the modem. Have not been able to reproduce this since.
Currently the MM logs are stating the following again : [filter] (tty/ttyAMA0): port filtered: tty platform driver
Current output from udevadm info /sys/devices/platform/soc/3f201000.serial is:
I think at this point it is best to contact the ModemManager developers on their modemmanager-devel mailing list. They are quite friendly and will provide useful insights. At least we will know whether this is currently possible under ModemManager - hopefully this is something that could be resolved through configuration only.
You may provide them with the ModemManager version used + full debug logs.
Before doing so however, can you please test with the latest balenaOS v2.47.0, since it includes the latest ModemManager update? There is a slight chance we can get lucky.
BTW, this is a really nice piece of hardware - quite useful for RPi users.
Trying to do the same on RPi 4 and the same 6fab hat. I’ll follow your path, and see if I can reproduce or find a solution. Thanks for doing some of the leg work! Will report back soon…
As @majorz said, the way to go is to tag the device with the ID_MM_DEVICE_PROCESS tag, so that the implicit whitelist rule allows the port to be probed and used. Tagging by the port name isn’t ideal though, you should better tag based on the devpath. What is the output of this command? $ realpath /sys/class/tty/ttyAMA0