• How to create partition tables on pycom (fipy) ?

    3
    0 Votes
    3 Posts
    73 Views
    No one has replied
  • 1 Votes
    1 Posts
    70 Views
    No one has replied
  • How to Deep sleep with SiPy + Pysense + 3.7V LiPo

    pysense sipy deep sleep low power
    9
    2 Votes
    9 Posts
    3k Views
    D
    @StijnK setup_sleep() is a function contained in the pycoproc.py library, and according to its code the maximum value is 2^24 - 1. So the maximum sleep time you could set is 16777215 seconds, which is about 4660 hours (more than six months). Here is the code of pycoproc.py in Github: https://github.com/pycom/pycom-libraries/blob/f848adcfb937e7b7bbc5f78db95840fa26dabe11/pybytes/pysense/lib/pycoproc.py#L24
  • 0 Votes
    19 Posts
    429 Views
    E
    @Oridroo said in How to read out the output of 'ezPyro SMD I2C Pyroelectric Infrared Sensor' via I2C command?: Would you please explain a bit how you did this calculation, like why you divided it by 4 and then right shifted? No, not and but OR, shift a binary number to left is equal to multiply this number by 2, shift a binary number to rigth is equal to divide this number by 2. This work for all power of 2 value. My question is, why we are shifting the bits to get the decimal value? Your sensor compute a value between 0 and (2^24-1), then we need to transfer this value by i2c bus, but i2c bus can only transport bytes by bytes. So manufacturer say in datasheet the sensors send the on i2c 3 bytes, the first byte is [23..16] bits of this number, the next is [15..8] bits of this value and the last is [7..0] of this value. So we have a byte array[3] of 8 bit after reading on i2c. To compute this in decimal we have to shift the first byte of array by 16 bits (or multiply by 65536 it's same result), the second byte as to be shifted by 8 bits (or multiply by 256 it's same result) and the last byte is added to the value. For the time being, my current working code is as below. I was getting continuous "OSError: I2C bus error" until I added one delay in between print("Analogue:", analog) & ana_sett = i2c.writeto_mem(0x65, 0x14, analog) The code was executing till printing 'Analogue' and then showing that I2C error. Please suggest me if you have any recommendation for the programme. No idea why you have this, but for me it's mean that the sensors doesn't be ready to anwser to the command. You can use smaller delay if you use time.sleep(0.1) you have 100 ms delay
  • pycom tutorial mistake

    1
    0 Votes
    1 Posts
    153 Views
    No one has replied
  • Get logged file via bluetooth on smartphone, possible?

    4
    0 Votes
    4 Posts
    339 Views
    J
    @KenM You don't need an external antenna for Wi-Fi, you can use the onboard ceramic antenna exactly like BLE.
  • Pymate: Understanding Virtual and Terminal Pins

    Moved
    15
    0 Votes
    15 Posts
    6k Views
    T
    I'm struggling to get this to work. After following the instructions seemingly exactly with a wipy2.0 running 1.18.2.r4, I run into an error: "Warning: Virtual write to unregistered pin 1" All I did was download the code from wipy2 after setting up pymate, and add: 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) right under where it says "# Initialize Virtual Pins and Terminal Pins Here" in the Pymate_basic.py file in the lib. I can't seem to figure out why this doesn't work since I am following this guide exactly. Is the only way to upload code through FTP? I seem to be able to download, edit, and re-upload the code through REPL when booted in safe mode. Is this a no-no? Please HELP! thanks
  • fipy telnet

    3
    0 Votes
    3 Posts
    241 Views
    M
    @robert-hh Yes, you are right. Now I see it working in two steps (could be better optimised). Using FTP to upload code and then using telnetlib to telnet the device and execute arbitrary command. Thanks. Just wondering if this is standard way? Thanks, M
  • Pass variable from main.py to lib class?

    rtc
    3
    0 Votes
    3 Posts
    587 Views
    D
    @misterlisty A technique to pass object references from main.py to other modules is to create a 'dummy' module to pass items like rtc and i2c. To make this work you first need to create an empty file called 'shared.py'. Then you can use it as follows: in main.py -- from machine import RTC, I2C import shared rtc = RCT() i2c = I2C(0, I2C.MASTER) shared.rtc = rtc share.i2c = i2c Then in the module you want to reference/use rtc or i2c, include an import to shared as follows: import shared shared.rtc.now() shared.i2c.scan()
  • Gpy AWS IOT Mqtt

    gpy umqtt aws iot mqtt
    12
    0 Votes
    12 Posts
    2k Views
    R
    @randomrnti Figured out my issue was due to the AWS policy only allowing certain clients for the iot:Connect policy. Changing it to the wildcard * fixed my issue. Another issue though is I can only get it working for Wifi. The moment I attempt this on NB-IoT I'm getting the following errors: AWSIoTMQTTClient Socket create error: [Errno -78] MBEDTLS_ERR_NET_SEND_FAILED simple.py Traceback (most recent call last): File "main.py", line 90, in <module> File "main.py", line 79, in run File "/flash/lib/simple.py", line 56, in connect OSError: [Errno 113] ECONNABORTED This again is on the connect action and I've tried with connecting using both the IP Address and it's domain name.
  • How to measure the current when Fipy + pysense working?

    ello
    6
    0 Votes
    6 Posts
    650 Views
    B
    @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!
  • Detect if REPL is connected

    repl help
    5
    0 Votes
    5 Posts
    1k Views
    R
    I am using a W01 module connected via P0, P1 (the standard Rx/Tx lines of the serial REPL) to a FT232R serial-USB-interface. The FT232R is powered from USB. By defining P0 (i.e. Rx) as input with pull down activated, it is possible to dectect if REPL (i.e. the USB) is connected (P0=1=yes) It may be interesting to note that UART operation is not affected by having Rx(P0) declared as digital input simultaneously. By this method, the module detects a serial console during boot and continues in REPL mode. If there is no active serial connection detected, it autostarts its application. I am not sure if this works with a Wipy since the serial-USB interface may be powered from the Wipy, possibly making the status of Rx independent of the USB cable connection.
  • BLE ATT Wrapper

    ble bluetooth
    1
    2 Votes
    1 Posts
    636 Views
    No one has replied
  • 1 Votes
    1 Posts
    556 Views
    No one has replied
  • coding? Module? Tutorials? (Newbie)

    lopy network tutorial
    7
    0 Votes
    7 Posts
    2k Views
    D
    @seb https://docs.pycom.io/tutorials/introduction should be the link (without final / ) causing Newbie panic :)
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Pysense 3D Model

    pysense 3d model case
    2
    0 Votes
    2 Posts
    1k Views
    X
    @berkelium Our hardware designer has provided these step files http://software.pycom.io/downloads/PyShieldsExp3_step.zip I haven't been able to open them myself yet but maybe you have better luck? I'd appreciate any feedback before we put these into the docs.
  • 0 Votes
    1 Posts
    703 Views
    No one has replied
  • 2 Votes
    1 Posts
    915 Views
    No one has replied
  • 0 Votes
    18 Posts
    6k Views
    G
    I follow the tutorial, checked config many times but my gateway seams to be still offline.. look stuck at the same place you where then posted this question. do you remember the things you've made different that made it work?

Pycom on Twitter