Event log statements are doubled

I am worried about the battery drainage, I get those events two up to 6 times for a single thing like on the picture


Where is this coming from?I don’t see that on the other beacon and they are both the same firmware after I updated. So I must be doing something wrong.

Please share the exact code that was used when those events were generated. Without it, it is really hard to tell what is wrong. Do you run the same code on both beacons? Is this behavior repeatable if you refresh WebIDE and re-upload micro-app? Does those repeated events are also available when device disconnected from WebIDE and is using LTE to send data to Cloud?

micro app:

var DESTINATION = {lat: 55.669274, long: 12.452558};
var SYNC_PERIOD = 12600;
sync.setSyncPeriod(SYNC_PERIOD);
var lastKnownLocation = null;
print('Sync period set');
storage.clear();
// setting 2,3,4G
lte.setTech(lte.Tech.GSM_LTE, lte.Region.EUROPE)
 
.catch((error) => {
print("error");
     cloud.enqueue('lte-tech', {error: error});
     sync.now(); });
     
// updating location every 4 hours conserving battery 
location.startUpdates((position) => {
      cloud.enqueue('position-change', { lat: position.lat, long: position.long});
    }, { minInterval: SYNC_PERIOD, minDistance: 0, timeout: 0});

// button turns alarm mode 
io.press(() => {
    now = modem.getOperators();
    print(now);
    sync.setSyncPeriod(300);
    sync.now();
    print('ALARM MODE');
    
    location.startUpdates((position) => {
      cloud.enqueue('position-change', { lat: position.lat, long: position.long});
     }, { minInterval: 300, minDistance: 1, timeout: 0});
    print('cordinates are send to cloud');
      
});

// alarm mode activated from distance 
cloud.onReceive( msg => {
 if(msg.type === 'stolen') {
  sync.setSyncPeriod(msg.payload.sync_period);}
  
}
);

cloud:

const request = require('request-promise');
module.exports = async function (event) {
    if (event.type === 'assets-update') {
        const assets = event.payload.assets;
        await request.post('http://127.0.0.1:8000/assets-update', {json: true, body: {assets}});
     }
}

I run the same code on both beacons, but it seems one of them is responding differently.I put back Hologram on both beacons, so I have time update on the beacons.Yes it is repeatable and varies. Sometimes is gives more than two times when I reinstall the app and adds one more repeated line with each reinstall. Good point when I check on one of the devices there is no disruption when I call it with curl, it might be only front end javascript problem of your cloud server again on your front end cloud.Also some times I ask for data from one beacon and I get data from the other one in the log ide on the server.I can not observe the other beacon at the moment, I am upgrading it with stronger antenna and non-rechargeable lithium battery so I won’t to toon down the lights first, the default value setting or something else is draining the batteries rapidly.

It looks like it is an issue in WebIDE. We are working on it. Beacon should deliver events properly when on LTE.

  1. If you are concerned about power consumption, please note that modem.getOperators() is a long and power hungry operation that will block modem operations up to few minutes before it is completed (see docs).
  2. modem.getOperators() returns a promise, which is a kind of asynchronous handler (read more about promises here). Printing it will always display [object Promise].
  3. Cloud Event Log displays events from for particular IoT App release. You don’t event need to be connected to see events from multiple devices.
  4. Remember to turn GPN down with location.stop() when “ALERT MODE” is canceled or at least to switch is back to longer interval (like 4h).
  5. Using non-rechargeable battery is not a good idea:
  • LTE Beacon has built-in charger that allows to recharge device using USB cable. If you replace original battery with non-rechargeable it will try to charge it which may damage that battery.
  • Device is not designed for that kind of battery. This may lead to unpredictable behaviour of the whole device on many levels.
1 Like

Thank you I will check and do everything you mentioned.It is the same voltage, current, resistance the battery should not be a problem. mine haves 30 times higher energy density than that conventional batterie that has to be changed every 2,3 years at best anyways. Don’t worry we know what we are doing and accepting any risk from upgrades as our fault cheki breki.

Hi Georgi! Thank you for feedback on our platform!

Can you describe the steps to reproduce the issue with duplicate logs in Web IDE? Please include also basic info about your setup, what OS and browser are you using.

1 Like

Hi Janusz, I guess you are the frontend and Lucasz is the backend judging by your pictures :slight_smile: . The issue has stopped accruing, nice work.

1 Like


Hi Janusz, I started having that issue again. here you can see how my ide looks like

Hi Georgi! Can you share with us some details on what actions do you perform before you start experiencing this issue? We can see from your screenshot that you are using Google Chrome on Linux (Ubuntu ?). Are you connecting to two devices from two different Chrome tabs?

We are looking into this issue but so far we cannot reproduce this behavior :sweat_smile: Can you please share with us the sequence of steps that leads to the duplication of logs?

Hi this is corret I use Ubuntu 18.04 Google Crome. Here is a screenshot:Screenshot%20from%202019-07-29%2010-32-27

I can send you my log in credentials if you like on janusz.grzesik@estimote.com

I inspected your application and it looks fine, it does not produce duplicate logs, so the reason must be somewhere else. More important is the sequence of steps that triggers this behavior. You mentioned that you are experiencing this issue after “switching” devices, what do you mean by that?

How do you connect to the beacon, do you reconnect, do you see any errors, do you perform actions in the IDE in other Chrome tabs? Don’t be afraid to share as much detail as possible :smiley:

By switching I ment I got the payload for green on ide cloud event log for blue and vice versa , that was one time.Another time I got the payloads for both devices on the cloud event log which is much better. This is not related to the dublicate data as far as I can tell. What I have notices about the dublicates is that acures on green beacon which works flowessly. On blue beacon which works from time to time I do not get that error.
I can not be 100% because I am not getting any signal from one of the devices (blue)for the last 4 days and I did not have GPS last position in beacon settings in IDE on it since I got it.The gps is working in it,it sends payloads outside of bluethooth distance 20% of the tests. There is a possibility it is a hardware problem but I can’t say I am not hardware guy. I will test another sim card on it and restart Hologram card for it.The Hologram card is picking one of 3,4 local providers on its own, if it hits TDC is works great if its another its behaving like that. So I will update this string when I figure out what is happening.