-
Notifications
You must be signed in to change notification settings - Fork 95
Cannot establish an MQTT connection from Thailand #228
Comments
HI Alex. The command sequence looks fine, seems to just be getting no MQTT broker connection within the time given. For your module type (SARA-R412M-02B-01 I believe) uMqttConnect() (the |
Hi @alexmaron81: how did this go in the end? |
Hi Rob, I haven't been able to test any further yet. I was on holiday last week. Friday I have another meeting with thailand. |
Can i ping an ip address? |
The cellular module does support a command called
...adding a header for it as follows in
|
Hi Rob, I'm getting an error AT+UPING="10.65.66.157" ERROR is it true what is written in the following link? |
can i do it in a different way? |
Not that I can think of I'm afraid. In theory you could connect at PPP-level and use the native ESP-IDF IP stack to do the ping but we have never tried making a PPP connection on a SARA-R412 and it would be a major change to the way your SW works to build and use PPP. If what you would like to do is to check connectivity with a specific server or servers, what I would do is run a UDP echo client on a known/open port of that server, then you could send UDP packets to that server on that port and check for the echoed response coming back. Of course you would need access to the server-side to do this. Mind you, you might need access to the server-side in any case to be sure that it is configured to respond to ping. Alternatively, beneath the MQTT protocol which I guess you are trying to test lies TCP, so if you opened a TCP connection on whatever your MQTT port is and that connection was successfully opened at TCP level then you have proved that there is connectivity, assuming that is your aim, you don't need to do any MQTT stuff at all. So you could just follow the pattern of the TLS sockets example (assuming you have TLS security) or otherwise the sockets example (if you don't have TLS security) to the IP address and port number of your MQTT broker. But that is, of course, a more complicated arrangement than a UDP echo arrangement or ping. |
The network that an LTE module or an LTE phone chooses to connect to when fitted with a roaming SIM depends on many things I'm afraid: SIM preference list order, previous successful registrations, signal strength ranges, RF bands, probably other things. If you do a network scan, i.e. something like:
...does 520:03 show up? If it does then at least it is broadcasting on radio bands that are compatible with the module, in which case you could potentially update the preference list on the SIM to put it at the top, or of course you could modify your code to manually select 520:03 but then you would have to do that specifically for the device(s) in Thailand, which would be a pain. |
Very strange: |
Hi Rob, the scan is still not executed. |
Not that I can think of: if the module is currently doing a scan, internally, itself, it might reject an attempt from the AT interface, but I would expect adding a delay or waiting a while and retrying to work in that case. If that is not working, we could try a more direct approach, as an experiment, which would be to manually select 520:03, so in the uNetworkCfgCell_t you pass to uNetworkInterfaceUp(), populate the field This would be an experiment only, to verify that (a) the cellular network is there and (b) it does what you want. |
I have already tried Manuel, but unfortunately no connection was established. |
Maybe band, but the most important thing is, for SARA-R412, the network must support CAT-M1 LTE (or GPRS). The phone that you put the SIM into will have been LTE, not CAT-M1 LTE. Does Advanced Wireless Network Company (AIS) support CAT-M1 LTE (or GPRS)? |
Ah, good, so you have 2G there. I expect you have configured the module into CAT-M1 only so you might get onto Advanced Wireless Network Company if you enable GPRS. Of course, if you have previously registered on an LTE network the device will go back there in preference but, for the purposes of this experiment, you can use manual selection to force it. To add GPRS to your RAT list, ranked behind CAT-M1 (which will be at 0), call uCellCfgSetRatRank(devHandle, U_CELL_NET_RAT_GSM_GPRS_EGPRS, 1), so something like:
|
Hi Rob, the connection to the APN is established in Thailand, but not to the MQTT.
Other devices in Germany work well.
Mobile provider 1nce (VPN)
ConnectionLogThai.txt
The text was updated successfully, but these errors were encountered: