• I2C output binary to integer

    3
    1
    0 Votes
    3 Posts
    230 Views
    V
    @Eric73 Thanks a lot!! Yes, goal is to compute int values instead of bytes.
  • neopixel and threading

    thread micropython neopixel ws2812b
    1
    0 Votes
    1 Posts
    109 Views
    No one has replied
  • 0 Votes
    2 Posts
    206 Views
    robert-hhR
    @jc_serg If you are looking for a ping.py script: there is one here: https://gist.github.com/91cc8979e33e82af6d99ec34c38195fb.git
  • variables starting with underscore

    2
    0 Votes
    2 Posts
    162 Views
    C
    MIcropython works a little different than python. In python you use the underscrore in front of variable to mark the variable as private. Nut it is still visible. In micropython these are real local variables an will not be exported. So a class will have a memory footprint which is slightly lower. The micropython page had this info once under the optimization part. I cannot find it right now. Maybe you have to play around with the version settings in the documentation.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    18 Views
    No one has replied
  • best practice for wifi connection

    wifi micropython best practices debug
    1
    0 Votes
    1 Posts
    171 Views
    No one has replied
  • ESP register access

    2
    0 Votes
    2 Posts
    240 Views
    robert-hhR
    @Elizar P20 can be used for the XTAL, but you have to attach it. Otherwise you can use it as normal GPIO pin. You can access the GPIO registers via machine.mem32. hex(machine.mem32[0x3FF44004]) will give you the hex value of the GPIO output register. Writing to it will change the output bits. machine.mem32[0x3FF44008] = 0x10 will set GPIO4 (P3) to high, without affecting the other GPIO pins, if it was configure for output. See the esp32 reference manual for the set of GPIO registers and it's options. Edit: Inline-Assembler or Viper code in not supported by the Pycom dialect of MicroPython
  • cbor orunpack ?

    2
    1 Votes
    2 Posts
    167 Views
    robert-hhR
    @quentho cbor is not implemented in Micropython. If it is straight python, it may be possible to use it. But if you do not have any compatibility constraints, you can use ustruct.pack() and ustruct.unpack(). You can also use the ujson.dumps() and ujson.loads() methods. But that is an ASCII format, which takes more space than a binary format. P.S.: I just looked into a cbor package from PyPi. It should be possible to port it to MicroPython, but it is quite a bunch of code.
  • Getting Static IP From Arduino - Using MicroPython WLAN

    3
    0 Votes
    3 Posts
    207 Views
    S
    @oligauc Oddly, I'm not getting the option on Android to assign a static IP address. Is there something about this connection's configuration that leads Android to believe that it cannot assign itself a static IP address? I've seen that option before on other networks, but I'm not sure how that option comes and goes.
  • EZO i2c board - Help with converting Python to uPy

    3
    0 Votes
    3 Posts
    220 Views
    S
    What do you want to do? Which sensors you need? Commercial or private project?
  • using c++ libs with micropython

    13
    0 Votes
    13 Posts
    772 Views
    robert-hhR
    @tttadam Very good.
  • I2C OLED Screen Error

    ssd1306 oled display i2c micropython
    7
    0 Votes
    7 Posts
    678 Views
    robert-hhR
    @kjm All versions have a usable I2C. The case here is a different one, I assume. @shanefowler25 : Can you publish the full error message you got. It should be more than one line. The framebuffer module is included now. It sneaked in when Pycom moved to MicroPython core V1.11.
  • noise level meter

    2
    0 Votes
    2 Posts
    162 Views
    T
    I come up with two solution. use this sensor, and the ADC in the pycom board. and compare the voltage values with a validated noise meter so I can specify which voltage values means which decibel values. simply use this uart sensor Right now option two is more favorable for me.
  • BLE - decoding service UUID

    8
    0 Votes
    8 Posts
    604 Views
    A
    Thanks @poesel. We picked that up and wrapped it [1] into two corresponding routines for your convenience: >>> from terkin.network.ble.util import BluetoothUuid >>> BluetoothUuid.from_bytes_le(BluetoothUuid.to_bytes_le('04500100-39fd-49ec-b565-b5d6dc31b6ae')) '04500100-39fd-49ec-b565-b5d6dc31b6ae' You will also find some background information about why that happens within the comments. Thanks also to @jmarcelino for uuid2bytes from [2]. [1] https://github.com/hiveeyes/hiveeyes-micropython-firmware/blob/a8249fd8e9895623de8047ca2d6478dba1351aa8/terkin/network/ble/util.py [2] https://forum.pycom.io/topic/530/working-with-uuid/2
  • Any MicroPython fans? Pros? Cons?

    4
    0 Votes
    4 Posts
    253 Views
    bmarkusB
    Yes I'm a MicroPython fun, it is a good chose for many use cases. But better to ask it at the MicroPython Forum, it is a pycom board. https://forum.micropython.org/
  • Handling WLAN and MQTT disconnects

    2
    0 Votes
    2 Posts
    300 Views
    O
    @cmisztur To check if you are connected to wifi you can use the isconnected() as show below from network import WLAN import time class WifiMonitor: def __init__(self): self.conn_timeout = 20 self.wlan = WLAN(mode=WLAN.STA) def _connect(self, ssid, pswd): if not self.wlan.isconnected(): print("Connecting to Wifi SSID: {} PASS: {}".format(ssid, pswd)) self.wlan.connect(ssid, auth=(WLAN.WPA2, pswd)) count_10ms = 0 while count_10ms <= self.conn_timeout * 100 and not self.wlan.isconnected(): count_10ms += 1 time.sleep(0.01) if self.wlan.isconnected(): print("WiFi connected: {}".format(self.wlan.ifconfig())) def connect_loop(self, ssid, pswd): while True: try: self._connect(ssid, pswd) except Exception as e: print("WIFI connection error: {}".format(e)) pass time.sleep(10) WIFI_SSID = 'my ssid' WIFI_PASS = 'my pass' wifi = WifiMonitor() wifi.connect_loop(WIFI_SSID, WIFI_PASS) For MQTT you can send a ping to the MQTT server
  • Pysense driver windows 10

    2
    0 Votes
    2 Posts
    193 Views
    C
    Win 10 does not need special drivers for normal tasks. You had to install them on Win 7, Now you need only DFU drivers when you have to update the firmware of the boards (psysemse, pytrack, extension 3.x). But the recommended drivers are s piece of crap. Use linux for this. a VM or a Raspberry Pi shall work fine.
  • AttributeError: 'MQTTClient' object has no attribute '_send_str'

    1
    0 Votes
    1 Posts
    183 Views
    No one has replied
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    20 Views
    No one has replied
  • This topic is deleted!

    3
    0 Votes
    3 Posts
    38 Views

Pycom on Twitter