LTE Beacon: Micro-app error reference
Error handling in micro-apps can be performed with standard JavaScript try ... catch
, for example:
var RECORD_ID_MY_DATA = 0;
var myData = {foo: 'bar'};
try {
storage.save(RECORD_ID_MY_DATA, myData);
} catch (error) {
if (error.code === 'ESR0202') { // ESR0202 = No storage space
print('out of space');
// free up some space, then retry storage.save
} else {
cloud.enqueue('storage-save-error', {code: error.code});
}
}
Here we try to save some data to beacon’s persistent memory. In the event of an error, we check the error code to determine if it’s an “out of space” error, or something else. Based on the outcome, our app can take an appropriate action: for example, maybe it can remove some unused or less important data. Or, if this is not an “out of space”, report the error to the cloud.
All errors are objects which look somewhat like this:
{code: 'ESR0202',
message: 'ESR0202 No storage space'}
You can also register a “global” error handler, to have any uncaught errors delivered to it:
app.setErrorHandler((type, error) => {
print('uncaught error: ' + error.message);
cloud.enqueue('uncaught-error', {code: error.code});
});
Below is a list of all documented errors.
- System errors
- VM errors
- Storage errors
- Modem errors
- Function call errors
- Cloud synchronization errors
- Type conversion errors
- GNSS errors
- BLE errors
- Sensors errors
- Firmware update errors
Error codes list
System errors
ESR0001 Unknown error
Source of error cannot be determined
ESR0002 Reboot loop detected.
Device started rebooting itself in a loop. To prevent this app was stopped. Now you can connect to device using WebIDE and upload new micro-app.
ESR0003 Unsupported feature.
Feature is unsupported on this hardware version.
ESR0004 Not enough resources
There are not enough resources (like timers or advertisers) to perform operation. Make sure you released all resource handles (eg. setting them to null) and stopped advertisers.
ESR0005 Time is not valid
Current system time is not synchronised yet and its value is incorrect. It will be synchronised during next Cloud sync via LTE or when using GNSS.
ESR0006 Deprecated function %s at line %d
This function is deprecated. Use other function instead because it may be removed in future releases.
ESR0007 Scheduler error
Scheduler is probably full and cannot accept more tasks into its queue. Try to execute some of your tasks one after another instead of running them at once.
VM errors
ESR0101 Internal VM error
Internal assertion caused JS VM to throw a fatal error. VM and app will be restarted.
ESR0102 Out of VM memory
Out of virtual machine heap memory, VM and app will be restarted. Try to reduce size of objects. Make sure you have no soft memory leaks.
ESR0103 VM executed too long
User code executed for longer than few seconds (depending on firmware release) and was interrupted. Probably caused by infinite loop or too many nested loops.
ESR0104 Execution interrupted
Execution was interrupted by another app being uploaded and installed. No action is required.
ESR0105 Out of slot execution
VM code was executed as it was running as native. This is an internal error and should not happen in normal use.
ESR0106 App install error %d
VM was unable to install application. There might be not enough storage space left.
Storage errors
ESR0201 Storage error
Storage system is not able to persistently save data. Probably it is overloaded with requests.
ESR0202 No storage space
Storage system is full. You need remove user data and/or synchronize device with Cloud.
ESR0203 Not serializable
Provided object cannot be converted to stream of bytes because it contains not serializable elements like handles or functions. Construct a new object that does not have such fields and try to serialize it.
ESR0204 Message too big
Message is too big to be stored. Reduce message size by removing unnecessary elements and using more compact data structures (like ArrayBuffer instead of hexadecimal String).
ESR0205 Data store timeout
Waiting for previous message to be stored has timed out. Consider less frequent storage write operations.
ESR0206 No more variables
There are no more slots for new Cloud variables. Consider joining variables in objects under same name.
ESR0207 Data store internal error %d
Low level internal error prevented function from completing. Report error code to technical support.
Modem errors
ESR0401 Modem unknown error
Not able to pin point source of an modem error
ESR0402 Modem timeout
Modem was processing command for more than maximum expected time.
ESR0403 Modem command error
Modem responded with an error, but was not kind enough to provide an error code.
ESR0404 Modem init error
Modem initialization procedure have failed. Usually trying again helps. If not you may try to reboot or power cycle device.
ESR0405 SIM card error/missing
SIM card is missing or is damaged. Check if it sits properly in the slot.
ESR0406 Modem too low voltage
Battery voltage is too low to allow the modem to work properly. Please charge the device.
ESR0407 Modem forced stop
Modem was forced to stop currently processed command by hardware reboot.
ESR0410 Airplane mode is on
Airplane mode is on and all radio operations are forbidden.
ESR0411 Invalid tech: %d
Invalid radio access technology value.
ESR0412 Invalid bandplan
Invalid bandplan enum or wrongly constructed bands object.
ESR0415 Not registrered
Modem was unable to register with cellular network within reasonable time. Signal strength and quality might be low so the best strategy is to try again some time later.
ESR0416 Initial config failed
Modem initial config failed. Try again.
ESR0413 Modem unlisted error: %d
Not able to find a error text for that internal code.
Function call errors
ESR0601 Bad args
Number, type or length of arguments does not match function signature and contract.
ESR0602 New operation
Previous async operation is still pending and there can be only one operation in progress. Previous promise has been rejected.
ESR0603 JS error:
JavaScript generic error. Please refer to ECMA Script documentation.
Cloud synchronization errors
ESR0701 Registration timeout
Modem was unable to register in cellular network
ESR0702 Firmware check failed
Device was unable to check for firmware update.
ESR0703 Modem fatal error
Modem stopped to respond to commands.
ESR0704 Request failed: %d
Synchronization request to the server failed. There might be some problems with infrastructure or Cloud.
Returned code is HTTP response code. Special codes:
- 702 - HTTP timeout
*709- network deactivated
*714 - DNS error
*719 - socket closed
ESR0705 Sync timeout
Synchronization takes too much time and will be forcefully stopped. It is probably some internal error.
ESR0706 Handler timeout
Sync handler returned a promise that took to long to resolve/reject and synchronization needed to continue.
Type conversion errors
ESR0502 Value out of range
Provided value is out of range of supported values.
ESR0503 Value out of enum range
Provided value is out of supported values defined by enum object. Try to use enum object instead of raw values.
ESR0504 Value is not valid interval
Provided interval string is invalid.
ESR0510 Odd char number
Trying to convert hex-encoded string, but it has odd number of characters
ESR0511 Not hex character
Trying to convert hex-encoded string, but one of the characters is not hex: 0-9 A-F
GNSS errors
ESR1202 minInterval longer than timeout: %d > %d
Minimal reporting interval is smaller than location process timeout value. It means it was set to finish before it even began.
ESR1203 Position not found
GNSS subsystem was not able to obtain geographical position with provided options
BLE errors
ESR1501 Scan start error: %d
Device is unable to scan for BLE packets
ESR1502 Invalid adv packet
Invalid advertising packet format. Function that constructs packet did not provide a valid object (may returned null or undefined).
ESR1505 Invalid UUID len
UUID for iBeacon is longer or shorter than 16 bytes
ESR1506 Invalid ID len
Invalid identifier length. It is longer or shorter.
Sensors errors
ESR1801 Unsupported event
Event type is not supported on this hardware revision
ESR1802 Bad event options
Event was provided with bad options. In case of MLC event check if model was defined and it contains non-zero even number of bytes.
ESR1803 Internal sensor error
Sensor returned error state. Probably its internal state got damaged.
ESR1804 Data too big
Provided data is too big to fit into memory buffer. Try to make you model smaller.
ESR1805 Bad data format
Provided model data is in wrong or unrecognized format
Firmware update errors
ESR2101 Internal DFU error %d
Internal firmware update error with code.
ESR2102 Invalid checksum
Calculated checksum does not match checksum provided with firmware image. This may indicate bad image or error during upload.
ESR2103 Bad hardware
Firmware image was prepared for different hardware revision.
ESR2104 Min version not meet
Current firmware is too old to be upgraded.
ESR2105 Firmware update timeout
Firmware update procedure waited too long for next data chunk.
ESR2106 Image too big: %db>%db
Firmware image won’t fint into memory. Probably this image is for different hardware version or has been corrupted.