Subcategories

  • General discussion for getting started and support

    723 Topics
    3k Posts
    robert-hhR
    @theshade Pycom INC is closed. And whoever purchased the assets did not buy the debts or responsibilities. Personally I'm upset that not even the technical documentation of their boards was published as a small feedback for the community.
  • For all topics related to the WiPy

    566 Topics
    3k Posts
    S
    @robert-hh okay, makes sense regarding the documentation. thanks for the information
  • For all topics related to the LoPy

    2k Topics
    9k Posts
    S
    I am facing a challenge when attempting to decompress data compressed using the miniz library on the ESP32 platform. My objective is to compress data using miniz library in flasher_stub compoment of esp-idf and then decompress the data on the cloud side using some python script that can be compatible with miniz decompression style like zlib. As per the documentation and information available, the miniz library is described as a "lossless, high-performance data compression library" that implements the zlib (RFC 1950) and Deflate (RFC 1951) compressed data format specification standards. However, I am encountering difficulties when attempting to decompress the compressed data using Python. Specifically, when using the Python zlib module, which should be compatible with the zlib and Deflate formats, I am receiving an "unknown compression method" error. I have verified that the file and data are correct, and they were compressed using the miniz library on the ESP32. Despite this, I am unable to successfully decompress the data. I would greatly appreciate any help or any insights that you can provide regarding how to properly decompress data that has been compressed with the miniz library using Python.
  • For all topics related to the SiPy

    163 Topics
    783 Posts
    M
    @matt3526 DID anyone figure this out?
  • For all topics related to the GPy

    411 Topics
    2k Posts
    D
    Hi, Just for reference, our GPy replacement Walter is going live on Crowd Supply very soon. We already tested with some beta testers and you can read the review in this topic: https://forum.pycom.io/topic/7748/the-future-of-pycom/32 For everybody interested, this is the Crowd Supply link: https://www.crowdsupply.com/dptechnics/walter
  • For all topics related to the FiPy

    531 Topics
    3k Posts
    robert-hhR
    @Julia-Steiwer As you should have noticed, Pycom Inc ceased it's operation, and there is no service any more for Pycom products, be it hardware or software like Pymakr. The latter should still work with the older VSCode versions. So if you want to use PyMakr, you have to stick with an working combo of an older VSCode version and PyMakr.
  • For all topics related to the Pymakr

    129 Topics
    599 Posts
    robert-hhR
    @Kalle-Misto Pymakr is not supported any more. It might help to fall back to a previous version of Vscode and keep it.
  • For all topics related to the Pymate

    10 Topics
    50 Posts
    T
    Hi, I think I'm doing everything correctly and following Roberto's tutorial to a T. I am getting errors when I try both reading and writing virtual pins. I am using a wipy 2.0 running firmware 1.18.2.r4 Here Is my process: set up pymate safe boot device, download files. edit pymate_basic.py in lib with code under "# Initialize Virtual Pins and Terminal Pins Here" restart, add widgets to app, and it always returns errors. Here are two examples of errors: a) When I try Roberto's first example of writing, I add the following code under "# Initialize Virtual Pins and Terminal Pins Here" to pymate_basic.py: # Initialize Virtual Pins and Terminal Pins Here import pycom def set_led_color(params): val = int(params[0]) if (val < 256): val = val & 0xFF elif (val > 255 and val < 512): val = (val << 8) & 0xFF00 elif (val > 511): val = (val << 16) & 0xFF0000 pycom.rgbled(val) pymate_library.add_virtual_pin(1,None, set_led_color) After uploading, and setting up a widget type slider with pin V1, and range 0-750, I slide the slider and get one of the following errors: "Error calling provided virtual method" 2)"Traceback (most recent call last): File "boot.py", line 39, in <module> File "/flash/lib/pymate_basic.py", line 25, in <module> File "/flash/lib/pymate_library.py", line 414, in run File "/flash/lib/simple.py", line 202, in wait_msg File "/flash/lib/pymate_library.py", line 352, in _recv_msg_callback File "/flash/lib/pymate_library.py", line 278, in _handle_hardware_msg KeyError: 32" 3)Warning: Virtual write to unregistered pin 1 b) When I try Roberto's second example of reading, I add the following code under "# Initialize Virtual Pins and Terminal Pins Here" from uos import urandom def read_random(): val = int(urandom(1)[0]) return val pymate_library.add_virtual_pin(1,read_random, None) After setting up the widget type to Display, pin V1, pin Mode INPUT, refresh Rate 500ms, I hit play, and I get the following error: Traceback (most recent call last): File "boot.py", line 39, in <module> File "/flash/lib/pymate_basic.py", line 19, in <module> File "/flash/lib/pymate_library.py", line 414, in run File "/flash/lib/simple.py", line 202, in wait_msg File "/flash/lib/pymate_library.py", line 352, in _recv_msg_callback File "/flash/lib/pymate_library.py", line 278, in _handle_hardware_msg KeyError: 32 Please help. There is very little documentation to go off of, and I can't find anything wrong with what I'm doing. Thanks
  • For all topics related to the Expansion Board

    298 Topics
    1k Posts
    D
    @Mr-Admin said in syntax question: mqtt_publish(client, "home-assistant/altitude", str(alt.altitude).encode('utf-8')) thank you, this looks like what I need
  • For all topics related to MicroPython

    417 Topics
    2k Posts
    K
    @robert-hh maybe wrong forum. I couldn't figure out the Github system and found this forum instead. Thanks for the tip on the USB cable. Hope it's that simple. .
  • PyGate range remote testing device?

    3
    0 Votes
    3 Posts
    64 Views
    G
    I think you would be able to use the Pytrack for your purpose. Now we currently have no ready to go example for that, but we are working on it in the background! You could also indeed check with ttnmapper.org, as they try to make a LoRa coverage map of the world! Best, Gijs
  • Doing a POST request over wifi to a HTTP server.

    2
    0 Votes
    2 Posts
    90 Views
    G
    @Mellow said in Doing a POST request over wifi to a HTTP server.: I am trying to send some data over http to a API using the urequest lib on my lopy4. However i am getting nowhere since after I did some fixes to the library due to the implementation of usocket being different for pycom board I am getting the following error: Looking through the library, it does nothing more than create a nice interface around the usocket library. The error should also happen when you try s = socket(); s.connect(('ipaddr',port)). Last time I saw this, the connection was rejected by the server, so it might be the case some firewall is blocking your request? Is the error intermittent or does it always happen?
  • PyGate-assert Failed Error

    11
    1
    0 Votes
    11 Posts
    298 Views
    G
    To your first question. It is correct you have to generate your own EUI to register your Pygate on the TTN network. To your second question, the example mentioned here: https://docs.pycom.io/tutorials/networks/lora/lorawan-otaa/ definitely works for me (I am not sure of the exact differences between the examples) you should be able to send messages to your Pygate when configured with the correct connection details. This indeed has to do with setting the correct dev_eui (next to the app_eui and app_key). If you are also receiving other LoRa packets in the TTN console through your Pygate gateway (send by nodes in your area), the Pygate is configured correctly.
  • Temperature specs

    wipy3.0 gpy
    4
    0 Votes
    4 Posts
    106 Views
    rcolisteteR
    See my Teensy 3.x/4.0 CoreMark, Temperature and Power Benchmark. With a simple black aluminium heatsink from Raspberry Pi the MCU temperturare of the Teensy 4.0 is up to 15 C lower. Other solution is to cover the case/box with reflective surface. I've had experienced 20-30 C lower temperature.
  • FCC, CE and RCM certification reports

    fcc rcm certification
    8
    0 Votes
    8 Posts
    2k Views
    G
    Hi, For our testing reports, we used something similar to this: from network import LoRa import socket import machine import time # initialise LoRa in LORA mode # Please pick the region that matches where you are using the device: # Asia = LoRa.AS923 # Australia = LoRa.AU915 # Europe = LoRa.EU868 # United States = LoRa.US915 # more params can also be given, like frequency, tx power and spreading factor lora = LoRa(mode=LoRa.LORA, region=LoRa.EU868) lora.frequency(868000000) # create a raw LoRa socket s = socket.socket(socket.AF_LORA, socket.SOCK_RAW) while True: # send some data s.setblocking(True) s.send('Hello') print("send packet") This puts the module in continuous transmission mode using the most simple modulation format. There is no hardware routine in the LoRa radio that supports the CW mode.
  • Pinging a second device on the LAN - how to?

    2
    0 Votes
    2 Posts
    85 Views
    robert-hhR
    @nigelwattrus The original uping.py code is here: https://gist.github.com/shawwwn/91cc8979e33e82af6d99ec34c38195fb I had to adapt it for the pycom microypthon variant. Code below: # µPing (MicroPing) for MicroPython # copyright (c) 2018 Shawwwn <shawwwn1@gmail.com> # License: MIT # Internet Checksum Algorithm # Author: Olav Morken # https://github.com/olavmrk/python-ping/blob/master/ping.py # @data: bytes def checksum(data): if len(data) & 0x1: # Odd number of bytes data += b'\0' cs = 0 for pos in range(0, len(data), 2): b1 = data[pos] b2 = data[pos + 1] cs += (b1 << 8) + b2 while cs >= 0x10000: cs = (cs & 0xffff) + (cs >> 16) cs = ~cs & 0xffff return cs def ping(host, count=4, timeout=5000, interval=500, quiet=False, size=64): import utime import uselect import uctypes import usocket import ustruct import uos # prepare packet assert size >= 16, "pkt size too small" pkt = b'Q'*size pkt_desc = { "type": uctypes.UINT8 | 0, "code": uctypes.UINT8 | 1, "checksum": uctypes.UINT16 | 2, "id": (uctypes.ARRAY | 4, 2 | uctypes.UINT8), "seq": uctypes.INT16 | 6, "timestamp": uctypes.UINT64 | 8, } # packet header descriptor h = uctypes.struct(uctypes.addressof(pkt), pkt_desc, uctypes.BIG_ENDIAN) h.type = 8 # ICMP_ECHO_REQUEST h.code = 0 h.checksum = 0 h.id[0:2] = uos.urandom(2) h.seq = 1 # init socket sock = usocket.socket(usocket.AF_INET, usocket.SOCK_RAW, 1) sock.setblocking(0) sock.settimeout(timeout/1000) addr = usocket.getaddrinfo(host, 1)[0][-1][0] # ip address sock.connect((addr, 1)) not quiet and print("PING %s (%s): %u data bytes" % (host, addr, len(pkt))) seqs = list(range(1, count+1)) # [1,2,...,count] c = 1 t = 0 n_trans = 0 n_recv = 0 finish = False while t < timeout: if t==interval and c<=count: # send packet h.checksum = 0 h.seq = c h.timestamp = utime.ticks_us() h.checksum = checksum(pkt) if sock.send(pkt) == size: n_trans += 1 t = 0 # reset timeout else: seqs.remove(c) c += 1 # recv packet while 1: socks, _, _ = uselect.select([sock], [], [], 0) if socks: resp = socks[0].recv(4096) resp_mv = memoryview(resp) h2 = uctypes.struct(uctypes.addressof(resp_mv[20:]), pkt_desc, uctypes.BIG_ENDIAN) # TODO: validate checksum (optional) seq = h2.seq if h2.type==0 and h2.id==h.id and (seq in seqs): # 0: ICMP_ECHO_REPLY t_elasped = (utime.ticks_us()-h2.timestamp) / 1000 ttl = ustruct.unpack('!B', resp_mv[8:9])[0] # time-to-live n_recv += 1 not quiet and print("%u bytes from %s: icmp_seq=%u, ttl=%u, time=%f ms" % (len(resp), addr, seq, ttl, t_elasped)) seqs.remove(seq) if len(seqs) == 0: finish = True break else: break if finish: break utime.sleep_ms(1) t += 1 # close sock.close() ret = (n_trans, n_recv) not quiet and print("%u packets transmitted, %u packets received" % (n_trans, n_recv)) return (n_trans, n_recv) Call it for instance with: from uping import ping ping("www.google.com")
  • Chirpstack gateway + Pycom Chirpstack server setup + Fipy

    1
    1
    0 Votes
    1 Posts
    62 Views
    No one has replied
  • Pyscan - demo nfc [SOLVED]

    4
    0 Votes
    4 Posts
    81 Views
    S
    @Summer SOLVED Wrong file position for pycoproc.py. It should be in lib with pyscan
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Soldering an external "Passive Antenna" to PyTrack?!?

    pytrack gps antenna
    2
    0 Votes
    2 Posts
    404 Views
    N
    @combaindeft Did you find any solution? We have ended up with the EXACT same problem. Poor antenna. I mean, good relative to the size – but our application is not size constrained. I actually consider abandonning the pytrack alltogether and get a seperate gps module, accellerometer etc.
  • Lora Gateway setup for loraserevr.pycom.io

    1
    0 Votes
    1 Posts
    95 Views
    No one has replied
  • LoPy to LoPy: Raw LoRa sf

    loramac raw lora spreading facto
    2
    0 Votes
    2 Posts
    171 Views
    L
    Just guessing, but you should probably set the same spreading factor on the receiver also?
  • Advice welcome; read thermistor, transmit over LTE, deepsleep

    7
    0 Votes
    7 Posts
    258 Views
    J
    @nwjlyons In addition, *Py modules are notoriously fiddly when it comes to deep sleep, and the GPy/FiPy even more. If you read through the forum, you'll see lots of stories about modules drawing more current than expected, modules not going to sleep or not waking up, etc. Be prepared to spend quite some time on that. It can do what is stated on the can, but it can be quite difficult to achieve. Be sure to get the correct firmware updates for both the ESP32 and the modem and the correct sequence of boot-attach-send-detach-sleep. Also make sure you get one of the newly calibrated GPys, they're supposed to give much better results. Finally, how do you plan to connect the battery? Behaviour can be quite different on battery than when running over USB. If you add a Pysense or Pytrack in between the battery and the GPy that's yet another thing that can quite a bit of complexity, especially when it comes to deep sleep and power consumption in deep sleep. If you connect the battery more or less directly, I remember having seen discussions about *Pys failing to wake in some circumstances. Nevertheless, many people achieved what you want to do, so do not despair. Just be warned that it may take a lot longer than just putting the things together and throwing a bit of code at it. Make sure you have the right tools at hand to mesure and monitor power consumption.
  • Can't get default AP to be visible

    3
    0 Votes
    3 Posts
    174 Views
    J
    Do you have wifi_on_boot enabled? See https://docs.pycom.io/firmwareapi/pycom/pycom/ Johan
  • Default LoPy 4 Wi-FI 802.11: b or n?

    2
    0 Votes
    2 Posts
    147 Views
    G
    @GMB124 I found out myself that the LoPy 4 standard settings are to use 802.11 n. Posting here just in case someone will look for the answer.
  • Send message from LoPy through BLE

    lopy ble
    7
    0 Votes
    7 Posts
    790 Views
    G
    @Eric73 I updated the firmware to 1.18 too and it works now. Thank you very much for your precious help and time!
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    6 Views
    No one has replied
  • Problem connect telephone to Fipy via bluetooth

    1
    0 Votes
    1 Posts
    199 Views
    No one has replied
  • daylight saving time

    Moved
    2
    0 Votes
    2 Posts
    236 Views
    J
    Hi @kjm I moved your topic to general seciton
  • LOPY4 +pytrack --> TTN?

    3
    0 Votes
    3 Posts
    299 Views
    robert-hhR
    @securigy The Pycom devices do not work well as a gateway: they support only a single channel. Take care that the node is configured to use that channel only. If that is properly set, the gateway receives messages from the node reliably. the timing is not very precise, especially that of LoPy4 and Fipy. Lopy is a little bit better. That results in downlink messages not arriving at the node. OTAA join relies on such a downlink message. Therefore, better use ABP as join. carefully follow the instructions to set up the gateway, and also have a look at the corresponding instructions at https://www.thethingsnetwork.org/docs/gateways/packet-forwarder/semtech-udp.html Connection the gateway should be straightforward. Since you receive ACK messages, the connection should be fine. Next define an application and a device with ABP as activation mode in it. During tests, you may disable frame counter checks in the settings of the device. That makes life easier. If you want to run a Lora gateway, get a full service device. There are quiet a few in the market.

Pycom on Twitter