mcci-catena / Catena-Arduino-Platform

Arduino platform library for MCCI Catena IoT Systems
MIT License
12 stars 11 forks source link

ReadAnalog fails #253

Closed drpuur closed 4 years ago

drpuur commented 4 years ago

I am using MCCI 4610 and see "?CatenaStm32L0::ReadAnalog(3): CatenaStm32L0_ReadAnalog() failed (5)" messages as in https://github.com/mcci-catena/Catena-Arduino-Platform/issues/125

This happens not all the time and seems to start happening only after some time.

Board Version: 2.7.0 System Clock: 24 MHz

Libraries: URL Commit Commit Date
https://github.com/mcci-catena/arduino-lmic.git 6fe04ec Tue, 12 May 2020 09:16:47 -0400
https://github.com/mcci-catena/arduino-lorawan.git 4bc0d48 Sat, 9 May 2020 12:38:28 -0400
https://github.com/mcci-catena/Catena-Arduino-Platform.git 92019ca Tue, 12 May 2020 01:34:08 -0400
https://github.com/mcci-catena/Catena-mcciadk.git a428006 Sat, 21 Dec 2019 20:45:26 -0500
https://github.com/mcci-catena/MCCI_FRAM_I2C.git f0a5ea5 Sat, 21 Dec 2019 16:17:01 -0500

I read the battery voltage on every iteration (after waking up from deep sleep):

  // vBat
  int vbat_mv = (int)(gCatena.ReadVbat() * 1000.0f);
  gCatena.SafePrintf("vBat:    %d mV\n", vbat_mv);

Attached is the log with the relevant lines. ReadAnalog-errors.txt

dhineshkumarmcci commented 4 years ago

@drpuur Thank you for bringing in the issue. Right time you raised this, We are already working on it. We have pushed a patch in the branch issue253. Can you please pull changes to your libraries and let us know how it works?

drpuur commented 4 years ago

@dhineshkumarmcci Great! I have just recompiled with branch issue253 and will let you know about the results.

drpuur commented 4 years ago

Not sure if this is related, but since this patch the node does not join any longer. I see the join requests in the console of the Lorawan Network (Swisscom), but it looks like the node never receives the join accept (even though SF12 is used).

I then did a reset of the board (using the switch), and now it looks like it lost the provisioning.

I attach the full log. serial-swisscom-11jun2020-1.txt

drpuur commented 4 years ago

It's pretty strange: I did a reset again (this time with "system reset"), and now the node came up just fine and also joined the network. I will capture the output again and report back.

dhineshkumarmcci commented 4 years ago

Hi Joerg,

We would like to know the vBus value logged before these changes in library. Can you also please make sure that no change in library is made at your end after cloning?

We tried to replicate the issue at your end. We have made stress test to behaviour at our end. We used Catena 4610, with library change in branch ‘issue253’. The result at our end is as below: Without USB connected - vBus: 3366 mV With USB connected - vBus: 5072 mV

From: drpuur [mailto:notifications@github.com] Sent: 12 June 2020 20:57 To: mcci-catena/Catena-Arduino-Platform Cc: Dhinesh Kumar Pitchai; Mention Subject: Re: [mcci-catena/Catena-Arduino-Platform] ReadAnalog fails (#253)

So far no errors, but I noticed a regression: no matter if I plug USB charging cable or not, it measures about the same value for vBus: with USB power cable attached: vBus: 1614 mV no USB cable attached: vBus: 1619 mV This is where that measurement comes from: // vBus float vBus = gCatena.ReadVbus(); gCatena.SafePrintf("vBus: %d mV\n", (int)(vBus * 1000.0f)); Since this is used to detect if the USB cable is plugged (fUsbPower) and I use this to decide if I go in deep sleep or not, this is pretty important for my use case that this works. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mcci-catena/Catena-Arduino-Platform/issues/253#issuecomment-643334602 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJMD7CVROZDPY22RNKL2XLLRWJCNXANCNFSM4N3EWL7A . https://github.com/notifications/beacon/AJMD7CQQVHVFDUIP34ZWKPLRWJCNXA5CNFSM4N3EWL7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEZMIDSQ.gif

drpuur commented 4 years ago

Hello Dhinesh

Sorry, must be something else. I deleted the comment after I made it, as it is not related with your patch. I have this on 2 of 4 4610 nodes, not sure what it is. I desoldered those and reused them on another PCB so it might be a hardware problem. When measuring with the multimeter I get correct values though. Maybe I just have to dump these, it‘s just a bit odd that two behave like that.

Best regards — Joerg

PS: I will report tomorrow if it still runs fine, until now there have been no problems.

Am 12.06.2020 um 21:17 schrieb Dhinesh Kumar Pitchai notifications@github.com:

 Hi Joerg,

We would like to know the vBus value logged before these changes in library. Can you also please make sure that no change in library is made at your end after cloning?

We tried to replicate the issue at your end. We have made stress test to behaviour at our end. We used Catena 4610, with library change in branch ‘issue253’. The result at our end is as below: Without USB connected - vBus: 3366 mV With USB connected - vBus: 5072 mV

From: drpuur [mailto:notifications@github.com] Sent: 12 June 2020 20:57 To: mcci-catena/Catena-Arduino-Platform Cc: Dhinesh Kumar Pitchai; Mention Subject: Re: [mcci-catena/Catena-Arduino-Platform] ReadAnalog fails (#253)

So far no errors, but I noticed a regression: no matter if I plug USB charging cable or not, it measures about the same value for vBus: with USB power cable attached: vBus: 1614 mV no USB cable attached: vBus: 1619 mV This is where that measurement comes from: // vBus float vBus = gCatena.ReadVbus(); gCatena.SafePrintf("vBus: %d mV\n", (int)(vBus * 1000.0f)); Since this is used to detect if the USB cable is plugged (fUsbPower) and I use this to decide if I go in deep sleep or not, this is pretty important for my use case that this works. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mcci-catena/Catena-Arduino-Platform/issues/253#issuecomment-643334602 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJMD7CVROZDPY22RNKL2XLLRWJCNXANCNFSM4N3EWL7A . https://github.com/notifications/beacon/AJMD7CQQVHVFDUIP34ZWKPLRWJCNXA5CNFSM4N3EWL7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEZMIDSQ.gif — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

drpuur commented 4 years ago

The error did not happen anymore so it really looks like this has been fixed. See Log.

ReadAnalog.log

dhineshkumarmcci commented 4 years ago

@drpuur Thank you for the update.

terrillmoore commented 4 years ago

This still has not been addressed. The reversion was never pushed again, but the docs were pushed.

terrillmoore commented 4 years ago

@mcciyssaroha please coordinate straightening this out.