How to measure the current when Fipy + pysense working?
-
Hello, I am working on building a LoRa-based IoT system by using a node composed by FiPy + pysense. I have successfully connect this node to TTN. So now I want to measure the power consumption when the node working via measuring the current. But I have no idea how to do this.
There are two problems:-
I use USB cable to upload programs (by Atom) and supply voltage rather than external battery. I can only run the program by button in Atom. But when I use external battery to supply power. How to run the program which has been uploaded in the FiPy without Atom?
-
The second one is that how to measure current when Fipy + pysense working?
-
-
@crumble
Very useful information! I have found the cause of the problem that I changed the file name as "mainA.py" to distinguish different code. Now, I corrected and the system worked. Thanks a lot!
-
ensure that your code is called in main.py If always use the run part, it seems that you never call you code in the boot process.
Otherwise welcome in the wonderful world of debugging.
Sadly you have only 3 ways:- use print to see the actual position and status. You can see this in a REPL via a telnet over WiFi as well. Use a long utime.sleep as first statement, so you can connect
- Write to a file instead to print your messages
- Play around with the LED colours to find the problem, if print and writes are too slow.
-
@bismarck501 No. It looks as if you did not permanently upload the scripts to the device. So Atom does a little bit of bug hiding. Try to upload your files with ftp and start them form the REPL command line.
-
@robert-hh Thanks for your response! Actually I can try to use some devices in university lab to measure in high precision. The problem is:
I program the FiPy to send message to TTN and upload the file to FiPy. Then only after I click "run" button in Atom window can the whole program run and work. That means I must use a computer with Atom to run FiPy.
If I use an external power supply, my FiPy module seems work because the blue LED lights. However, there is no data transmitted to TTN.
-
@bismarck501 There are low cost (low precision) USB power meters which you can insert into the USB cable, for instance this one: https://de.aliexpress.com/item/RD-UM34-UM34C-f-r-APP-USB-3-0-Typ-C-DC-Voltmeter-amperemeter-spannung-strom/32880908871.html?spm=a2g0x.search0604.3.15.1df826c79yO79Y&s=p&ws_ab_test=searchweb0_0%2Csearchweb201602_2_10320_10065_10068_10547_319_317_10548_10696_453_10084_454_10083_433_10618_431_10304_10307_10820_10821_537_10302_536_10902_10843_10059_10884_10887_10319_321_322_10103%2Csearchweb201603_45%2CppcSwitch_0&algo_pvid=96ee37b7-9c9a-4fcb-b034-bb2e6b672244&algo_expid=96ee37b7-9c9a-4fcb-b034-bb2e6b672244-1
But there are gazillion of the like. They do not tell you low current values. The one above has a lowest reading of 1 mA.
You can also take a USB cable, split the 5V wire (red) and insert a DMM for current measurement. And there is professional equipment for that purpose, at a price tag of several 100 €.