LTE-M is not avaiable in the UK, it’s GSM or NB-IOT provided by Vodafone with the V-sim offering.
I know that the lte.setTech function is no longer supported.
In previous releases I was able to use this, when set to lte.Tech.GSM, to return valid and correct cell and signal data from the getStatus and getCells functions.
This I can no longer do.
The enumerations of the values are still there along with region settings but no function seems available to use them. Is there a recommended approach to configure the modem to specific technology types and regions?
From our data it looks like LTE-M is available in UK, but it might not cover whole country. You need to check it with your local operators. 0.2.12 should have LTE-M and GSM enabled by default and if there will be no LTE-M signal, modem should switch to GSM. There is no need to use setTech
to force this behavior.
Message should say that function is deprecated: ESR0006 Deprecated function setTech
. This means that it still works, but it is considered obsolete and users are not encouraged to use it, because it may be removed in the future.
Device is by default configured to work globally and handle as many different operators as possible. There should be no need to change modem configuration.
setTech
is an unofficial and undocumented function, intended for internal use. It may be removed without further notice (that’s why there is now a message). Use it on your own risk since setting wrong parameters may prevent device from communicating with the cloud via modem.
and signal data from the getStatus and getCells functions.
This I can no longer do.
Can you elaborate more why it is not possible in new release? Do you get error message? If so, what is that error message? Does function never resolve or reject a promise? Or it returns empty list?
Here’s the log of a test I did this morning with two LTE beacons one with 0.2.6 the other with 0.2.12. I hope it helps. Code first:
function setRadioTech() {
print('Setting modem to GSM only');
lte.setTech(lte.Tech.GSM)
.then(() => {
print('setTech success');
})
.catch((error) => {
print('setTech error: ' + error);
});
}
//
print(sys.getFirmware());
// setRadioTech();
modem.getInfo()
.then((info) => print("Card Info:" + JSON.stringify(info.imei)))
.catch((e) => print("Card Error: " + e))
modem.getOperators()
.then((opers) => print("Operators: " + JSON.stringify(opers)))
.catch((e) => print("Operators Error: " + e))
/*
modem.getCells()
.then ((cells) => print("Cells: " + JSON.stringify(cells)))
.catch ((e) => print("Cells Error: " + e))
//
modem.getStatus()
.then((status) => print("Status:" + JSON.stringify(status)))
.catch((e) => print("Status Error: " + e))
*/
Log next
Remove SIM card
[10:05:19] 0,2,6
[10:05:19] Setting modem to GSM only
[10:05:19] App started successfully
[10:05:19] setTech success
[10:05:38] Error: Error: ESR0405 🔗 SIM card error/missing
[10:05:38] Error: Error: ESR0403 🔗 Modem command error
Add vodafone V-SIM card
[10:08:26] 0,2,6
[10:08:27] Setting modem to GSM only
[10:08:27] App started successfully
[10:08:27] setTech success
[10:08:32] Card Info:"862785040515036"
[10:08:46] Operators: [{"name":"vodafone UK","status":"avail","type":"gsm"},{"name":"EE","status":"avail","type":"gsm"},{"name":"O2 - UK","status":"avail","type":"gsm"}]
Operators now recognised so disconnect add call to getCells connect and re-run
[10:17:24] 0,2,6
[10:17:24] Setting modem to GSM only
[10:17:25] App started successfully
[10:17:25] setTech success
[10:17:30] Card Info:"862785040515036"
[10:17:43] Operators: [{"name":"vodafone UK","status":"avail","type":"gsm"},{"name":"O2 - UK","status":"avail","type":"gsm"},{"name":"EE","status":"avail","type":"gsm"}]
[10:18:11] Cells: [{"name":"vodafone UK","rssi":-90,"mcc":234,"mnc":15,"lac":163,"cell":11011,"tech":"GSM","band":"GSM 900","channel":35},{"name":"EE","rssi":-91,"mcc":234,"mnc":30,"lac":2012,"cell":4179,"tech":"GSM","band":"GSM 1800","channel":658},{"name":"O2 - UK","rssi":-86,"mcc":234,"mnc":10,"lac":21407,"cell":34579,"tech":"GSM","band":"GSM 900","channel":411253}]
Operators and Cells now recognised so disconnect add call to getStatus connect and re-run
[10:28:50] 0,2,6
[10:28:50] Setting modem to GSM only
[10:28:50] App started successfully
[10:28:50] setTech success
[10:28:56] Card Info:"862785040515036"
[10:29:35] Operators: [{"name":"vodafone UK","status":"avail","type":"gsm"},{"name":"O2 - UK","status":"avail","type":"gsm"},{"name":"EE","status":"avail","type":"gsm"}]
[10:30:03] Cells: [{"name":"vodafone UK","rssi":-87,"mcc":234,"mnc":15,"lac":163,"cell":11011,"tech":"GSM","band":"GSM 900","channel":35},{"name":"O2 - UK","rssi":-83,"mcc":234,"mnc":10,"lac":21407,"cell":34579,"tech":"GSM","band":"GSM 900","channel":117},{"name":"EE","rssi":-99,"mcc":234,"mnc":30,"lac":2012,"cell":4179,"tech":"GSM","band":"GSM 1800","channel":411282}]
[10:30:43] Status:{"name":"vodafone UK CIOT Vodafone","signal":11,"rssi":-92,"ber":99,"mcc":234,"mnc":15,"lac":163,"cell":11011,"tech":"EDGE","band":"GSM 900","address":"0.0.0.0","indicators":{"service":true,"gprs":true,"roaming":true,"signal":40}}
All correct.
So disconnect from 0.2.6 firmware. This now proves that the 0.2.6 firmware returns the correct data when the SIM card is V-SIM and the modem setting is set to GSM. There are two other services avaiable O2 and EE. Comment out the getCells
& getStatus
functions
Now repeat with a device with 0.2.12,
Remove SIM card
[10:45:21] 0,2,12
[10:45:21] Setting modem to GSM only
[10:45:21] ESR0006 🔗 Deprecated function setTech
[10:45:21] App started successfully
[10:45:21] setTech success
[10:45:40] Card Error: Error: ESR0405 🔗 SIM card error/missing
[10:45:40] Operators Error: Error: ESR0403 🔗 Modem command error
That’s consistent with expected results.
Disconnect Add vodafone V-SIM card connect and re-run
[10:50:55] 0,2,12
[10:50:55] Setting modem to GSM only
[10:50:55] ESR0006 🔗 Deprecated function setTech
[10:50:55] App started successfully
[10:50:55] setTech success
[10:51:14] Card Error: Error: ESR0405 🔗 SIM card error/missing
[10:51:14] Operators Error: Error: ESR0403 🔗 Modem command error
[10:51:35] Disconnected from the LTE Beacon
[10:51:41] Scanning for LTE Beacons
[10:51:51] Connecting to selected LTE Beacon
[10:51:53] Successfully connected to LTE Beacon eb23fa0cdaa46624395af9ff50ade610
[10:52:05] Successfully compiled Micro App code. Compiled size: 540B / 16kB (3%)
[10:52:06] Successfully sent compiled Micro App code to the LTE Beacon
[10:52:06] 0,2,12
[10:52:06] Setting modem to GSM only
[10:52:06] ESR0006 🔗 Deprecated function setTech
[10:52:06] App started successfully
[10:52:06] setTech success
[10:52:21] Card Error: Error: ESR0405 🔗 SIM card error/missing
[10:52:21] Operators Error: Error: ESR0403 🔗 Modem command error
This was run twice with the SIM card in. In both cases the results returned no sim card.
So disconnect then comment out the setRadioTech call connect and run the modified code
[10:57:23] Successfully connected to LTE Beacon eb23fa0cdaa46624395af9ff50ade610
[10:57:49] Successfully compiled Micro App code. Compiled size: 537B / 16kB (3%)
[10:57:50] Successfully sent compiled Micro App code to the LTE Beacon
[10:57:50] 0,2,12
[10:57:50] App started successfully
[10:57:56] Card Error: Error: ESR0405 🔗 SIM card error/missing
[10:57:56] Operators Error: Error: ESR0403 🔗 Modem command error
Same results, with the exception that there’s no deprecated function message.
As a last test change the SIM card to the LTE-M one that came with the LTE
disconnect, connect and re-run
[11:02:51] Successfully connected to LTE Beacon eb23fa0cdaa46624395af9ff50ade610
[11:02:56] Successfully compiled Micro App code. Compiled size: 537B / 16kB (3%)
[11:02:57] Successfully sent compiled Micro App code to the LTE Beacon
[11:02:57] 0,2,12
[11:02:57] App started successfully
[11:03:02] Card Error: Error: ESR0402 🔗 Modem timeout
[11:03:02] Operators Error: Error: ESR0403 🔗 Modem command error
This is a different sequence of error messages. Revert to the V-SIM and retry.
[11:07:11] Successfully compiled Micro App code. Compiled size: 537B / 16kB (3%)
[11:07:12] Successfully sent compiled Micro App code to the LTE Beacon
[11:07:12] 0,2,12
[11:07:12] App started successfully
[11:07:13] Card Info:"862785040508569"
[11:07:39] Operators Error: Error: ESR0402 🔗 Modem timeout
That’s better but the IMEI is different it’s 862785040508569 and should be 862785040515036.
Now retry one more time for the world.
[11:13:34] Disconnected from the LTE Beacon
[11:14:08] Scanning for LTE Beacons
[11:14:19] Connecting to selected LTE Beacon
[11:14:23] Successfully connected to LTE Beacon eb23fa0cdaa46624395af9ff50ade610
[11:14:33] Successfully compiled Micro App code. Compiled size: 537B / 16kB (3%)
[11:14:34] Successfully sent compiled Micro App code to the LTE Beacon
[11:14:34] 0,2,12
[11:14:34] App started successfully
[11:14:51] Card Info:"862785040508569"
[11:14:58] Operators Error: Error: ESR0402 🔗 Modem timeout
Same result as last time. Sun was out so I went and did something else.
P.S
I live in the west of the UK where LTE-M is not yet available, which is why I chose NB-IOT
You have got ESR0405 🔗 SIM card error/missing
probably after swapping SIM cards when modem was still performing some operations. This may cause timeout errors later until modem is power-cycled. Connecting and disconnecting from beacon using WebIDE has no effect on modem operation.
Generally we are not supporting using other SIM cards than provided, however it technically should be possible but you need to experiment on your own.
IMEI is an identifier unique to a modem (or a cell phone). If you run your code on two different beacons, you will get two different numbers. If you want to get SIM card number use iccid
field. You can read more about IMEI, ICCID and IMSI here.
As I live in an area not yet covered by LTE-M (which is supported by the SIM you provide) more work on these beacons in their current state would be somewhat pointless. Many thanks for your time and help.