Communication script works when SIM card is not inserted, and we receive NO CARRIER error correctly.
However, whenever we insert SIM card, the communication stops. Modem does not respond to very first AT message and finally we get timeout error.
Does anyone have any possible solution for this? It doesn’t give us too much room to test, just no communication at all when the SIM card is inserted, and is OK when the SIM is removed.
We apologize for the inconvenience, but it seems that the ppp package has been updated, causing our tutorial to become outdated. We’ll update the wiki page soon, but for now, here’s a quick fix to help you establish a mobile connection:
Open the file /etc/chatscripts/quectel-chat-connect and make sure it contains the following lines:
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 30
"" AT
OK ATE0OK AT+CEREG?
OK AT+CEREG=1
OK AT+COPS?
OK AT+COPS=0
OK AT+CGDCONT=1,"IP","<your desired APN>"
OK ATD*99#
CONNECT
Thanks for quick reply. Unfortunately after applying new script we see no changes in operation, it stops in the same moment as previously. Note, this is stock RaspberryPi4B 2GB RAM from JustPi package, with stock/default latest Raspbian image and followed by tutorial instructions.
(…)
timeout set to 30 seconds
send (AT^M)
expect (OK)
^M
alarm
Failed
Script chat -s -v -f /etc/chatscripts/quectel-chat-connect -T internet finished (pid 2188), status = 0x3
Connect script failed
Edit: after some repeated try of running the script we’ve seen that once it went one step more, however again locked:
(…)
timeout set to 30 seconds
send (AT^M)
expect (OK)
^M
OK
-- got it
send (ATE0OK^M)
expect (AT+CEREG?)
alarm
Failed
Script chat -s -v -f /etc/chatscripts/quectel-chat-connect -T internet finished (pid 2590), status = 0x3
Connect script failed
It looks like there’s an issue in your script. The logs show that the Pi expects (AT+CEREG?) instead of OK. Please review your script to ensure it was copied or rewritten correctly.
Thanks. I just copied the script that was sent by you in previous message here:
Now by looking at it I see there might be error in your script here:
OK ATE0OK AT+CEREG?
I changed this and added new line after ATE0, although this did not change situation. Also I already replaced the “your desired APN” with the “internet” text.
I constantly reboot the TRM240 device before running script.
Please note, that communication hangs on very first AT command after the TRM240 was reconnected and booted (PWR and LTE leds are lit, NET led is blinking). See screenshot below:
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 30
"" AT
OK ATE0
OK AT+CEREG?
OK AT+CEREG=1
OK AT+COPS?
OK AT+COPS=0
OK AT+CGDCONT=1,"IP","<your desired APN>"
OK ATD*99#
CONNECT
I rechecked my test device and experienced similar issues with responses not being delivered. However, after unplugging both devices from power, waiting for some time, and then plugging them back in, the issue you were having was fixed.
Additionally, are you able to get an internet connection from TRM240 plugged into another device like a PC or similar?
two different and brand new devices Raspberry PIs 4B, both setup from scratch from stock Raspbian image
two different and brand new devices TRM240
two different and brand new SIM cards and two providers, both also tested on regular phone and confirmed working
Whenever SIM card is inserted and modem connects to LTE the serial communication hangs with no response.
We tried rebooting both devices multiple times. Frankly speaking if you encountered the same problem at least once we can not move forward with possible failures and scale this up.
We also tested by connecting modem to macOS 14.5 but nothing happens when device is connected and we could not find any documentation with configuration steps for macOS.
Our conclusion is that TRM240 does not support Raspberry PI and we will have to send these devices back. Thanks for your support.
I doubt this is a TRM240 issue, as the connection is definitely possible. I recommend trying other Raspberry Pi images that don’t require CLI setup. Images like Ubuntu, Parrot, or others have automatic modem detection (though sometimes the APN needs to be entered depending on the device).
Hi Marcin,
go one step further “down to the hardware”.
Try accessing the TRM240 via minicom terminal.
Are you sure the modem is on /dev/ttyUSB3?
Sounds funny. Usually the devices are number starting with 0 (zero).
Minicom should tell you if there’s a device listening on a certain port.
Maybe the device number changes if you unplug and then replug it?
Just a few thoughts from a “serial communication guy”.
Thanks for your reply. The /dev/ttyUSB3 responds correctly when SIM card is not inserted, so I guess it’s not the case. The problems start only when the LTE led is lit, it even works for a few seconds when modem is connecting to LTE with card inserted.
We downloaded ParrotOS and will check it there. Where we can find tutorial/documentation how to setup ParrotOS to connect to TRM240 modem? We created new mobile connection, selected provider, APN etc. in System Settings but it does not work (i.e. is not visible in available networks), so we may need some additional steps to make the connection? Thanks.
There is no tutorial because, in most cases, it is just plug and play. The TRM240 should work when connected to a Raspberry Pi with most newer Linux distros, as they have automatic modem recognition and setup, similar to Windows or other computers.
Thanks Marijus, understood and expected so, but unfortunately not in this case. Nothing happens when I plug TRM240 to Parrot OS. I created mobile connection manually via some wizard but it says the connection is not available, and it does not show up in the current network connections list.
We have two TRM240s and two RaspberryPIs, both do not work. I connected TRM240 to MacBook without luck. Could be that’s just faulty hardware indeed, although I doubt it as we tested two devices. And I assume macOS does not support TRM240 out of the box (btw. it shows up as “Android device” in macOS).