Subcategories

  • General firmware discussion

    154 Topics
    685 Posts
    A
    The Pass to IP Layer .... string is generated into lwip library. I've added that string into the ethernet.c file that is part of the lwip library. I've built the wifi/scan project and then substituted the lwip.a file into the pycom-micropython project. The code used to generate that strings is something like this LWIP_DEBUGF(ETHARP_DEBUG, ("Pass to IP Layer \n")); Of course i've changed the ETHARP_DEBUG value from LWIP_DBG_OFF to LWIP_DBG_ON into lwipopts.h header file in order to enable the ETHARP DEBUG. The TCP - _send_receive ... string is generated at level application. I'm using a TCP Modbus external python library. I've added the following code into the library print('TCP - _send_receive - Receive %s' % response) The application (and the modbus tcp library of course) is frozen into the final build and then uploaded through pycom firmware update tool. TCP Modbus messages are managed from a manager that runs as a python thread. The log output is got from USB interface.
  • Firmware wishlist & desired features

    52 Topics
    236 Posts
    J
    @Gijs I think it's a concern of many users that Pycom is spreading resources thin by working on too many new products which never see the light of day while not following up enough on the existing products. Let's just consider this list of Pycom vapourware: PyGo 1/2 + PyLife : first announced 25/09/2018 (soon to be 3 years ago). PyNode range: announced 25/06/2020 PyNode Touch: announced 06/07/2020 Expansion board V4: announced 14/10/2020 M.2 format boards: announced 17/11/2020 ESP32-S3-based boards: announced 01/02/2021 PyNode+ range: announced 08/02/2021 I know time-to-market can be essential in this industry but this is getting a bit out of hand...
  • Anything related to firmware issues & bugs

    267 Topics
    2k Posts
    G
    I am having the same problem. Is there a solution?
  • OEM L01 module firmware

    lopy other
    2
    0 Votes
    2 Posts
    645 Views
    J
    @andreas-bruring For the L01 you should use the LoPy1 firmware, the firmware then detects the expanded RAM.
  • Error when uploading to LoPy4

    sigfox lopy bug
    3
    0 Votes
    3 Posts
    888 Views
    L
    The file is called main.py, and it always was, so i don't think it can be it. I have a project created, and all the file are inside, i can access it through windows explorer as well, for the code, i can explain it, and post a screen about it if you want. I use the internal RTC (even if i can't update the time, i can initialise it and do something when X date is reached, even if there is no save if the system is not alimented anymore, that's enough for me) i also use an analogic pin for taking a battery pourcentage, and i send a message when a pin receive something. If you really want all the code here it is from network import Sigfox from machine import Pin from machine import RTC import pycom import socket import machine import time class ComSigFox: msg = "" localisation = "" socket = "" Etat = "" tailleManquante = 0 Compteur = 0 def __init__(self): # Initialise SigFox en Europe (RCZ1) localisation = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1) def sendMsg(self, paramMsg): pycom.rgbled(0x007f00) # vert # Créer un socket SigFox s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW) # Bloque le socket s.setblocking(True) # Configure le socket en Uplink seulement (False / True) s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False) msg = paramMsg msg += " %" if((len(msg) ) < 5 ): # Si le message fait en dessous de 5 caractères tailleManquante = 5 - (len(msg)) for Compteur in range(tailleManquante): msg = msg + " " # On rajoute des espaces autant de fois # Que nécessaire pour avoir 5 caractères Etat = "Close" if(Etat == "Open"): Etat = "Open " msg = msg + Etat s.send(msg) return True class Batterie: Voltage = 0 Charge = 0 def __init__(self): pass def getBattery(self): adc = machine.ADC(bits = 10) # create an ADC object apin = adc.channel(pin='P20', attn = machine.ADC.ATTN_11DB) # create an analog pin on P20 i = 0 MoyenneVolt = 0 for i in range(1,50): time.sleep(0.1) val = apin() - 698 Mesure = (val / 1024) * 5 MoyenneVolt += Mesure Voltage = MoyenneVolt / 49 print(Voltage) # Condition tension avec équation 0 - 10% de charge if(Voltage >= 1.32496 and Voltage <= 1.41429): Charge = (429.71806 * pow(Voltage,2)) - (1065.15152 * Voltage) + 656.90476 # Condition tension avec équation 10 - 30% de charge if(Voltage > 1.41429 and Voltage <= 1.45895): Charge = (404108.59608 * pow(Voltage,3)) - (1741647.28089 * pow(Voltage,2)) + (2502325.58922 * Voltage) - 1198510 # Condition tension avec équation 30 - 60% de charge if(Voltage > 1.45895 and Voltage <= 1.52594): Charge = (540257.28470 * pow(Voltage,4)) - (3000615.37231 * pow(Voltage,3)) + (6220087.42278 * pow(Voltage,2)) - (5699263.94063 * Voltage) + 1945763.58460 # Condition tension avec équation 60 - 100% de charge if(Voltage > 1.52594 and Voltage <= 1.58921): Charge = (348000.83082 * pow(Voltage,3)) - (1629386.97406 * pow(Voltage,2)) + (2543268.59982 * Voltage) - 1323295.17637 Charge = int(round(Charge,0)) print("") print(Charge) print("") # La fonction int() n'arrondit pas, elle ne fait que tronquer, ainsi, il faut faire un int de l'arrondi qui seras par exemple # 49.0, le résultat seras donc le nombre 49. return Charge class HorlogeRTC: rtc = 0 Date = 0 stringHeureDate = "" stringMinutesDate = "" stringSecondesDate = "" intHeureDate = 0 intMinuteDate = 0 intSecondesDate = 0 HeureSouhaite = 0 MinuteSouhaite = 0 SecondeSouhaite = 0 HeureFinal = 0 MinuteFinal = 0 SecondeFinal = 0 TempsTotalAttente = 0 def __init__(self): rtc = RTC() rtc.init((2018, 5 , 16 , 17, 19, 50, 0 )) # rtc.init(Année , mois , jours , heures , minutes, secondes, millisecondes) def getTime(self): Date = RTC().now() return Date def CalcTime(self,Date): Jour = False stringHeureDate = Date[3] stringMinutesDate = Date[4] stringSecondesDate = Date[5] s_intHeureDate = int(stringHeureDate) * 3600 s_intMinutesDate = int(stringMinutesDate) * 60 s_intSecondesDate = int(stringSecondesDate) s_TempsTotalActuel = s_intHeureDate + s_intMinutesDate + s_intSecondesDate HeureSouhaite = 17 * 3600 MinuteSouhaite = 20 * 60 SecondeSouhaite = 10 s_TempsTotalSouhaite = HeureSouhaite + MinuteSouhaite + SecondeSouhaite # TempsTotalAttente en seconde if(s_TempsTotalSouhaite < s_TempsTotalActuel): TempsTotalAttente = (s_TempsTotalSouhaite - s_TempsTotalActuel) * -1 else: TempsTotalAttente = s_TempsTotalSouhaite - s_TempsTotalActuel if(Jour == False): Jour == True return TempsTotalAttente elif(Jour == True): return 86400 + TempsTotalAttente def TempoVerifMesure(TempsRestantHorlogeParam): Max = 0 Diviseur = 0 TempsAttenteBoucle = str(TempsRestantHorlogeParam) print(TempsAttenteBoucle) if(len(str(TempsAttenteBoucle)) == 5): Diviseur = 10000 TempsAttenteBoucle = int(TempsRestantHorlogeParam) / Diviseur if(len(str(TempsAttenteBoucle)) == 4): Diviseur = 1000 TempsAttenteBoucle = int(TempsRestantHorlogeParam) / Diviseur if(len(str(TempsAttenteBoucle)) == 3): Diviseur = 100 TempsAttenteBoucle = int(TempsRestantHorlogeParam) / Diviseur if(len(str(TempsAttenteBoucle)) == 2): Diviseur = 10 TempsAttenteBoucle = int(TempsRestantHorlogeParam) / Diviseur print(TempsAttenteBoucle) #Pin de l'ILS #ILS = Pin('P23',mode=Pin.IN,pull=Pin.PULL_UP) Max = Diviseur pycom.rgbled(0x7f0000) # red for i in range(0,Max,1): time.sleep(TempsAttenteBoucle) print("Tempo... {0}".format(Max)) #if(ILS() == True): # return True return True if __name__=="__main__": Horloge = HorlogeRTC() # On initialise la classe HorlogeRTC Battery = Batterie() # On initialise la classe Batterie SigFox = ComSigFox() # On initialise la classe ComSigFox pycom.heartbeat(False) while(True): #Le programme tourne en permanance dans cette boucle envoiSigFox = False while(envoiSigFox == False): # Tant que le message SigFox n'est pas envoyé on boucle ici Date = Horloge.getTime() # On récupère la date TempsRestantHorloge = Horloge.CalcTime(Date) # On calcule le temps restants avant la date souhaite en secondes intCharge = Battery.getBattery() if(TempoVerifMesure(TempsRestantHorloge) == False): # Condition pour que le message SigFox s'envoie (Temporisation de TempsRestantHorloge + vérif ILS) pycom.rgbled(0x7f7f00) # jaune else: SigFox.sendMsg(str(intCharge)) envoiSigFox = True
  • nrf24l01

    esp32 wipy
    8
    0 Votes
    8 Posts
    2k Views
    robert-hhR
    @pedrofelipest said in nrf24l01: Please verify a) the intended connection as below CE on P6 -> GPIO27 CSN on P21 ->GPIO26 SCK on P22 ->GPIO25 MISO on P12 -> GPIO21 MOSI on P20 -> GPIO33 b) The semantics of the SPI method may be different between the poerts. Please compare the different ports (Pycom and micropython) by printing the results and self.buf content from write_register and read_register.
  • UART buffer flush

    lopy lora other
    4
    0 Votes
    4 Posts
    1k Views
    S
    Hi, Yes, it seems to be the same issue. When can I expect a fix for this? Any work around? any other api to check new data arrival at UART? Regards Sameer
  • Not able to receive downlink data on LoPy

    lopy lora
    6
    0 Votes
    6 Posts
    2k Views
    R
    @sameerchouksey Did you try this example https://docs.pycom.io/chapter/tutorials/lora/lorawan-otaa.html ? Especially: # make the socket blocking # (waits for the data to be sent and for the 2 receive windows to expire) s.setblocking(True) # send some data s.send(bytes([0x01, 0x02, 0x03])) # make the socket non-blocking # (because if there's no data received it will block forever...) s.setblocking(False) # get any data received (if any...) data = s.recv(64) print(data) Also try to upgrade FW to 1.17.x (lorawan have changed to 1.0.2 spec).
  • Debug WiPy WPA2-EAP Connection

    wipy wifi
    2
    0 Votes
    2 Posts
    948 Views
    A
    I was looking for alternatives to the ESP32, but I have discovered that Pycom is also based on ESP32. There is a problem with ESP32 connecting to WiFi using WPA2 Enterprise. It seems that you are having the same problem. Reference: https://github.com/espressif/arduino-esp32/issues/1381
  • Pysense Expansion Board External Header not working

    wipy other bug
    5
    0 Votes
    5 Posts
    1k Views
    A
    Hi @jmarcelino, wow you're right a reminder to always read exactly!! Thanks so far! Now I ran the program with the corrected PINs several times but I still have the issue that I get sensor readings just at a maximum one time per run. I am sure the Hc-sr04 has 5V as needed and the logic level converter should also not be an issue as both trigger, echo and ground are correctly connected to it. I annexed the Atom Output to this post after uploading the new program: Running C:\Users\pmb\Desktop\Wipytest\wipysensortest.py Distance 1 cm Disconnected. Click here to reconnect. Connecting on COM5... Running C:\Users\pmb\Desktop\Wipytest\wipysensortest.py Disconnected. Click here to reconnect. Connecting on COM5... Running C:\Users\pmb\Desktop\Wipytest\wipysensortest.py Traceback (most recent call last): File "<stdin>", line 34, in <module> KeyboardInterrupt: raw REPL; CTRL-B to exit Disconnected. Click here to reconnect. Connecting on COM5... Running C:\Users\pmb\Desktop\Wipytest\wipysensortest.py Running C:\Users\pmb\Desktop\Wipytest\wipysensortest.py Distance 45 cm Disconnected. Click here to reconnect.
  • FiPy LoRaWAN OTAA join freezing after subband selection

    lora fipy bug
    9
    0 Votes
    9 Posts
    2k Views
    B
    I have raised a ticket for the issue of allowing dr_min > 0 for channels 64-71, tested the fix and added a pull request. Hope that it helps (it is working for me!). Regards, Brian
  • Change FiPy from 868 to 916 MHz

    fipy lora
    3
    0 Votes
    3 Posts
    936 Views
    S
    So I need to do both, i.e. upgrade and change code or is changing my code to declare AU915 is not enough? thanks Simon p.s. just tried changing code and did not see it post to my gateway.
  • Expansion board v3.0 doesn't go in Dfu mode

    fipy
    7
    2
    0 Votes
    7 Posts
    2k Views
    catalinC
    hi @Matthew, First, you should not have anything plugged in the Expansion Board, no Lopy/Fipy. On Windows, the fact that went up to 96% and stopped, means there are USB problems(lots of retries and timeout). Try changing something, USB port, cable. We had lots of problems with poor USB cables. Maybe try to remove other USB peripherals, from your PC. On Linux, please, check if board is in dfu mode, looking at lsusb output, 04D8:EF99 should be visible. It's not clear from dfu-util error, Cannot open DFU device 04d8:ef99, if the device is not enumerated or you don't have rights. As wild try, maybe you should keep just RX and TX jumpers, on Expansion Board. <later edit>: FYI, the Expansion board 3 has already the latest firmware, we released just once
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • How to know to which LoRa Nano-Gateway the LoPy Connects

    lopy lora
    4
    0 Votes
    4 Posts
    927 Views
    robert-hhR
    @grtvhecke said in How to know to which LoRa Nano-Gateway the LoPy Connects: do you need to check in code the device and send an ack or not depending to this ID Yes
  • Firmware upgrade issue WiPy 3.0

    wipy
    5
    3
    0 Votes
    5 Posts
    1k Views
    I
    @xykon Note to self: connect the ground of the USB-to-serial converter to the WiPY's ground :) This was the issue all along. Can't believe it actually worked in putty though Thanks for all the help.
  • Change log and what's included in the FW build

    other
    4
    0 Votes
    4 Posts
    837 Views
    sebS
    Thats correct, The modules in the mods directory are ones coded in C and compiled into the firmware, the modules in frozen are written in micropython but they are also compiled into the firmware.
  • getsizeof

    lopy
    2
    0 Votes
    2 Posts
    484 Views
    robert-hhR
    @sameerchouksey sys.getsizeof() is not implemented in micropython. For strings and arrays, len() may give you a useful response, depending on your needs.
  • Building my own firmware?

    fipy lopy
    20
    1 Votes
    20 Posts
    5k Views
    G
    Yes @jcaron , I cleaned up everything and made the process all over again a couple of times. Same result every time. I haven't checked out the suggestion of @Xykon yet. For the moment I have given up with pycom (my final objective is to implement a nanogateway able to operate with downlink messages), and I am using a multitech gateway and microchip nodes for my project because I need to move on, and the process with pycom as gateway is way too complicated and time consuming. However, I will return to this subject as soon as possible.
  • Trying to install MicroPython 1.9.3

    wipy
    4
    0 Votes
    4 Posts
    1k Views
    sebS
    @jmpratt For the WiPy2 you will need to follow the instructions found here: https://docs.pycom.io/
  • Pysense Deepsleep Timer Accuracy

    esp32 lopy
    3
    0 Votes
    3 Posts
    999 Views
    J
    Hi @catalin Sorry I couldn't answer before. If the esp32 frequency is 160MHz the pysense timer works fine, it only has trouble when the frequency is changed. I am going to measure the error better to see if there is a clear relation between the frequency change and the timer error. Thanks,
  • FW Version & os.uname

    lopy lora
    9
    0 Votes
    9 Posts
    2k Views
    J
    It’s probably a better option to try to make it work with the current version of the firmware, otherwise you may have issues down the road when you need something else added or fixed. What are your settings on your sensors? In which direction to you have traffic flowing?
  • New FW 1.17.1.b1 ?

    fipy
    4
    1 Votes
    4 Posts
    1k Views
    R
    @seb I'll try later today. Thanx ;)

Pycom on Twitter