<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[PySense hardware versions 1.0 vs 1.1 with Lopy - battery lifetime issue]]></title><description><![CDATA[<p dir="auto">Hi, I'm working on a prototype with Pysense + Lopy + 3xAA batteries as power source.<br />
When I'm using a Lopy (Firmware 1.17.5.b6) on my Pysense <strong>V1.1</strong> (Firmware 0.0.8), the power consumption looks ok and the battery slowly drains.<br />
If I take the exact same Lopy with no Software changes and put it on a Pysense <strong>V1.0</strong> the battery drains much faster.</p>
<p dir="auto">I have no idea how this is possible, since there should be no difference between V1 and V1.1!?<br />
I just want to send temperature + humidity to my gateway and go back to deepsleep.</p>
<p dir="auto">Here is my code:<br />
(there a some useless parts - temp1, temp2, temp3 etc which I am sending over LORA, because if everything is working correctly, I want to send more data. But first I have to find my battery issue)</p>
<pre><code>from pysense import Pysense
from SI7006A20 import SI7006A20
from si7021 import SI7021
from network import LoRa
import binascii
import socket
import struct
import machine
import time
import pycom
import utime
from machine import I2C, Pin
from machine import WDT
import uos

wdt = WDT(timeout=60000)  # 60 sec - watchdog
pycom.heartbeat(False) # turn off heartbeat

_VERSION_SENSOR = 1.14

# A basic package header
# B: 1 byte for the deviceId
# B: 1 byte for the pkg size
# B: 1 byte for the messageId
# %ds: Formated string for string
_LORA_PKG_FORMAT = &quot;!BBB%ds&quot;
_LORA_PKG_ACK_FORMAT = &quot;BBBB&quot;
_LORA_PKG_LONG_ACK_FORMAT = &quot;BBBBB&quot;

# This device ID, use different device id for each device
_DEVICE_ID = 0x04

wdt.feed()
WIFI_MAC = binascii.hexlify(machine.unique_id()).upper()

py = Pysense()
if (py.read_fw_version() &lt; 8):
    while(True):
        pycom.rgbled(0x001111)
        time.sleep(3)
        print('read_fw_version: '+str(py.read_fw_version()))
        print('uos.uname(): '+str(uos.uname()))

si = SI7006A20(py)
temp2 = si.temperature()
hum = si.humidity()

temp3 = 99.99
voltage = py.read_battery_voltage()
temp1 = temp2
pressure = 90000
lowest = 0
highest = 0

myMessage = WIFI_MAC+ ';%.2f;%.2f;%.2f;%i;%i;%.0f;%.2f;%.2f' % (temp1, temp2, hum, lowest, highest, pressure, temp3, voltage)

msg_id = 1
lora = LoRa(
    mode=LoRa.LORA,
    region=LoRa.EU868,
    frequency=868100000,
    power_mode=LoRa.TX_ONLY,
    tx_power=7,
    bandwidth=LoRa.BW_125KHZ,
    sf=9,
    preamble=8,
    coding_rate=LoRa.CODING_4_8, #CODING_4_8
    tx_iq=False,
    rx_iq=False
)
lora_sock = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
lora_sock.setblocking(True)
pkg = struct.pack(_LORA_PKG_FORMAT % len(myMessage), _DEVICE_ID, len(myMessage), msg_id, myMessage)
lora_sock.send(pkg)

sleep = 60*15

if (voltage &gt; 1):
    if (voltage &lt; 3.33):
        sleep = 60*60*24
    elif (voltage &lt; 3.4):
        sleep = 60*60
    elif (voltage &lt; 3.5):
        sleep = 60*45
    elif (voltage &lt; 3.55):
        sleep = 60*30

py.setup_sleep(sleep)
py.go_to_sleep()
</code></pre>
<p dir="auto">Does anybody know, why there could be a difference between V1.0 and V1.1 of the Pysense?<br />
What could I do, to extend the battery lifetime? If i use sf7 or sf8, my packets are not received reliable.</p>
<p dir="auto">Any help is appreciated :)<br />
Thanks in advance</p>
]]></description><link>https://forum.pycom.io/topic/3494/pysense-hardware-versions-1-0-vs-1-1-with-lopy-battery-lifetime-issue</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Mar 2026 01:45:21 GMT</lastBuildDate><atom:link href="https://forum.pycom.io/topic/3494.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 17 Jul 2018 06:41:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PySense hardware versions 1.0 vs 1.1 with Lopy - battery lifetime issue on Tue, 17 Jul 2018 06:41:04 GMT]]></title><description><![CDATA[<p dir="auto">Hi, I'm working on a prototype with Pysense + Lopy + 3xAA batteries as power source.<br />
When I'm using a Lopy (Firmware 1.17.5.b6) on my Pysense <strong>V1.1</strong> (Firmware 0.0.8), the power consumption looks ok and the battery slowly drains.<br />
If I take the exact same Lopy with no Software changes and put it on a Pysense <strong>V1.0</strong> the battery drains much faster.</p>
<p dir="auto">I have no idea how this is possible, since there should be no difference between V1 and V1.1!?<br />
I just want to send temperature + humidity to my gateway and go back to deepsleep.</p>
<p dir="auto">Here is my code:<br />
(there a some useless parts - temp1, temp2, temp3 etc which I am sending over LORA, because if everything is working correctly, I want to send more data. But first I have to find my battery issue)</p>
<pre><code>from pysense import Pysense
from SI7006A20 import SI7006A20
from si7021 import SI7021
from network import LoRa
import binascii
import socket
import struct
import machine
import time
import pycom
import utime
from machine import I2C, Pin
from machine import WDT
import uos

wdt = WDT(timeout=60000)  # 60 sec - watchdog
pycom.heartbeat(False) # turn off heartbeat

_VERSION_SENSOR = 1.14

# A basic package header
# B: 1 byte for the deviceId
# B: 1 byte for the pkg size
# B: 1 byte for the messageId
# %ds: Formated string for string
_LORA_PKG_FORMAT = &quot;!BBB%ds&quot;
_LORA_PKG_ACK_FORMAT = &quot;BBBB&quot;
_LORA_PKG_LONG_ACK_FORMAT = &quot;BBBBB&quot;

# This device ID, use different device id for each device
_DEVICE_ID = 0x04

wdt.feed()
WIFI_MAC = binascii.hexlify(machine.unique_id()).upper()

py = Pysense()
if (py.read_fw_version() &lt; 8):
    while(True):
        pycom.rgbled(0x001111)
        time.sleep(3)
        print('read_fw_version: '+str(py.read_fw_version()))
        print('uos.uname(): '+str(uos.uname()))

si = SI7006A20(py)
temp2 = si.temperature()
hum = si.humidity()

temp3 = 99.99
voltage = py.read_battery_voltage()
temp1 = temp2
pressure = 90000
lowest = 0
highest = 0

myMessage = WIFI_MAC+ ';%.2f;%.2f;%.2f;%i;%i;%.0f;%.2f;%.2f' % (temp1, temp2, hum, lowest, highest, pressure, temp3, voltage)

msg_id = 1
lora = LoRa(
    mode=LoRa.LORA,
    region=LoRa.EU868,
    frequency=868100000,
    power_mode=LoRa.TX_ONLY,
    tx_power=7,
    bandwidth=LoRa.BW_125KHZ,
    sf=9,
    preamble=8,
    coding_rate=LoRa.CODING_4_8, #CODING_4_8
    tx_iq=False,
    rx_iq=False
)
lora_sock = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
lora_sock.setblocking(True)
pkg = struct.pack(_LORA_PKG_FORMAT % len(myMessage), _DEVICE_ID, len(myMessage), msg_id, myMessage)
lora_sock.send(pkg)

sleep = 60*15

if (voltage &gt; 1):
    if (voltage &lt; 3.33):
        sleep = 60*60*24
    elif (voltage &lt; 3.4):
        sleep = 60*60
    elif (voltage &lt; 3.5):
        sleep = 60*45
    elif (voltage &lt; 3.55):
        sleep = 60*30

py.setup_sleep(sleep)
py.go_to_sleep()
</code></pre>
<p dir="auto">Does anybody know, why there could be a difference between V1.0 and V1.1 of the Pysense?<br />
What could I do, to extend the battery lifetime? If i use sf7 or sf8, my packets are not received reliable.</p>
<p dir="auto">Any help is appreciated :)<br />
Thanks in advance</p>
]]></description><link>https://forum.pycom.io/post/20914</link><guid isPermaLink="true">https://forum.pycom.io/post/20914</guid><dc:creator><![CDATA[b3da]]></dc:creator><pubDate>Tue, 17 Jul 2018 06:41:04 GMT</pubDate></item></channel></rss>