• To run a C++ program in Micropython

    MicroPython c++ python micropython
    2
    0 Votes
    2 Posts
    1k Views
    robert-hhR
    @jhoguaman You can not. There is no OS on pycom modules. Micropython is the OS. If you build your own firmware, you can write C modules, wich you then can call from Python.
  • 0 Votes
    5 Posts
    2k Views
    S
    @seb I have not attached it yet, was doing the homework on what will work best. Will try it on the 3.3V, might go with a digital reading as all I am looking for is a true/ false statement to activate the relay
  • Getting started

    MicroPython micropython sigfox help
    2
    0 Votes
    2 Posts
    854 Views
    J
    When I started I first read this tutorial to understand the Python language. Not everything is available in Micropython, but you get the concept: https://docs.python.org/3/tutorial/ I looked up details uniqe to Micropython here when I found something from Python that was not working: http://docs.micropython.org/en/latest/pyboard/ For Pycom functionality documentation and examples are available here: https://docs.pycom.io/ Johan
  • 0 Votes
    19 Posts
    6k Views
    L
    @sunrise17 you must modify esp_get_revision - i do not have guide but on the forum you can find such posted by @robert-hh https://forum.pycom.io/post/13828
  • 0 Votes
    4 Posts
    2k Views
    N
    @robert-hh Thanks for that (and your assistance on my other question). I would be interested in your thoughts on how the "main" thread would check these flags as that goes back into using some kind of event/interrupt to know the timer/sensor readings have read something in. My first thoughts would be a while loop with a sleep count and checking periodically but feels like that is not the correct way to go about it. At this stage I am currently working with two or three period alarms executed from the "main" thread and a single secondary thread that is in a while loop and constantly sleeping looking for values at certain intervals which it then does the "heavy" processing and sending. @crumble - Yes I must admit I need to get out of some of my older habits to focus more on efficiency than simplicity/readability. However, I must admit I have been struggling to find material on how Micropython, specifically, works with allocation of memory for objects/variables/functions and what is the most efficient practice. Most examples go back to pure Python requiring multiple libraries to do memory statistics, even then not actually demonstrating what is the best way. Simple questions as to how the GC works, if I need to set variables to 'None' at the end of a function, or the use of a list over three distinct variables. The only way I am really finding it is by doing it both ways and testing it with gc.mem_free() which is time consuming and feels more like guess work. Would be interested on your point 4 about modules and compiling at boot time.
  • 0 Votes
    7 Posts
    3k Views
    J
    @johanbrichau thanks for your example project! I am having trouble getting this to work based on your project. are you able to share an example of you config.py file? How do you load the rsa file and generate it?
  • Search Engine Python Code

    Discussion micropython
    6
    1 Votes
    6 Posts
    1k Views
    L
    @rcolistete Nothing really wrong. But if i for example need something for micropython i do: google: something micropython git e.g: WS2812 micropython git and result is really really better then on above link ;-)
  • wlan.scan() errno 12 ENOMEM

    MicroPython wifi memoryerror esp32 micropython
    2
    0 Votes
    2 Posts
    1k Views
    robert-hhR
    @dhblumenfeld1989 This cannot be the full script. At least a two lines are missing upfront, like: from network import WLAN wlan = WLAN(mode=WLAN.STA) And as a side note: The flash size you get with uos.getfree() is not relevant for memory errors. These are caused by RAM shortage. The size of free RAM is told by gc.mem_free(). And for all people trying to help it is useful to know the firmware version, which can be obtained by uos.uname().
  • 0 Votes
    1 Posts
    637 Views
    No one has replied
  • List of OSErrors

    MicroPython oserror wipy micropython
    3
    0 Votes
    3 Posts
    1k Views
    T
    See my answer regarding oserror from tls in the post: https://forum.pycom.io/topic/2164/lopy-http-post-request-oserror/9
  • 0 Votes
    4 Posts
    1k Views
    C
    Hi...I haven't found anything short of implementing a significant chunk of the bluetooth protocol stack (which I have no desire to take on).All of the bluetooth modules I've been able to find are similar to the one used by the arduino BT in that they only support one serial connection. smt assembly service
  • MicroPython Unable to access REPL

    Projects micropython python
    2
    0 Votes
    2 Posts
    1k Views
    robert-hhR
    @giranp Good morning. First of all: You're in the wrong forum. The port for ESP8266 is supported at forum.micropython.org. Besides that, what you did is right. The information missing is: a) which kind of board are you using? b) did you set the access rights for /dev/ttyUSB0, or better, are you as user in the dialout group? You shoud get an error message if not. c) When connected, try Ctrl-C or Ctrl-B or Ctrl-D, whether this changes the behviour.
  • how to change some bits in an byte result

    MicroPython micropython i2c
    6
    0 Votes
    6 Posts
    2k Views
    L
    @jiemde bytes is immutable you must first convert it to mutable type like bytearray e.g. a=bytes([1,2,3]) #create bytes in your case steep not needed you have it already as result from readfrom_mem b=bytearray(a) #convert it to bytearray b[1]=11 #change value to what you need a=bytes(b) #change it back to bytes if you need to
  • I2C support clock stretching ?

    MicroPython micropython pycom lopy sipy wipy i2c
    5
    0 Votes
    5 Posts
    1k Views
    J
    Hi @livius, yes mailbox! here is the text in the documentation of the CCS811 chip: Programming Model: For flexibility and software driver maintenance simplification the CCS811 does not support direct addressing of registers over the I2C bus. Instead it supports single byte mailboxes identifiers that behave as proxies for registers with specific functionality and data sizes. To access a register an I2C transaction must be issued with the target address on the CCS811 being equal to the intended mailbox, this by way of proxy opens access to the register's functionality. In this manner the programming model is rigidy fixed while allowing the underlying firmware to be inherently flexible, extensible and configurable. That's chinese for me! Jiemde
  • CCS811 library ?

    MicroPython ccs811 micropython i2c
    6
    0 Votes
    6 Posts
    2k Views
    ledbelly2142L
    @jiemde Thanks! I forked it. Cheers!
  • 0 Votes
    13 Posts
    6k Views
    robert-hhR
    @monersss Then, start your script with: from network import LoRa import socket import time import os os.dupterm(None) ...
  • Reading data through Uart

    MicroPython sipy uart micropython
    3
    1
    0 Votes
    3 Posts
    1k Views
    C
    Good pickup, I will try and use P10 and P11 unless you recommend anything else? Edit, it works now thanks for the help
  • Wifi RSSI and mqtt subscribe

    MicroPython micropython mqtt wifi rssi rgb
    3
    0 Votes
    3 Posts
    2k Views
    S
    @this.wiederkehr Thanks, I will try that later tonight.
  • 0 Votes
    6 Posts
    2k Views
    S
    @ledbelly2142 Not yet, I did read somewhere here that the battery voltage is connected to ADC pin 16 so it should be possible. Hoping for an example that can report it as a Battery percentage. I'd like to have the following Topic structure on my LoPy's MQTT topic: lopy/ip lopy/probes/1 ... lopy/probes/4 lopy/battery lopy/rgb lopy/oled/1 ... lopy/oled/4 lopy/ble Cant think of any more yet. Still not sure how i'll go with my plan of 4x SPI Type K temp probes and 4x 128x32 OLEDs as they are SPI as well and require more than just a CS per screen. Reporting on the Battery topic would be things like percentage when it hits internal warning levels.. but with the view to using deep sleep it would probably report on wake up. Also a notification when its charging if at all possible would be nice. I changed the IP topic and paylod to this btw client.publish(topic="lopy/ip", msg=wifiaddress) And on the far end I use Node-red to append to the front: "LoPy Booted with IP: " + msg.payload; *node red function code - not micropython And send the string to Pushover for a push notification on my phone. I've also mapped the on board button to do a machine.reset() so I can carry it around, hit reset then get a notification on my phone if it connects to WiFi (good for range testing).