• Firmware update without expansion board

    SiPy sipy firmware software help
    13
    0 Votes
    13 Posts
    2k Views
    S
    @robert-hh Thanks for the info I have so much to learn I don't know where to start!! Best would be to find a good micro python training course and starting from scratch
  • Sipy recognized as Lopy?

    Getting Started sipy firmware
    3
    0 Votes
    3 Posts
    907 Views
    O
    hi Andrei, thanks for your reply! as the matter of facts, the version of the pycom upgrade I have installed didn't let me choose between the platforms, so i don't know how did I get the wrong firmware. anyway i'll follow the instruction in your thread. thanks again
  • Firmware update fails

    SiPy sipy firmware sipy update sipy
    2
    1
    0 Votes
    2 Posts
    992 Views
    F
    This issue is now resolved. Thanks! https://github.com/pycom/pycom-micropython-sigfox/issues/77#issuecomment-334796725
  • [SOLVED] Can't update the firmware

    SiPy sipy firmware sipy firmware
    7
    0 Votes
    7 Posts
    2k Views
    O
    It works ! Thank you !
  • Updater Fails on all platforms

    SiPy sipy firmware sipy update
    3
    0 Votes
    3 Posts
    906 Views
    S
    Thanks for the super fast reply @robert-hh I am using bare board yes i can successfully connect to the device- in normal boot i get the python prompt, and with the jumper on GP23 i get "waiting for download" Pc is connected to the internet As above GPIO0 is tied to ground I have just solved the issue- i had selected the south african server in the menu, which failed. I now selected Europe (because it's also RCZ1) and this worked perfectly. Thanks again for the help!
  • Issues using Bluetooth with SiPy

    SiPy sipy sipy firmware bluetooth wifi
    7
    0 Votes
    7 Posts
    2k Views
    A
    @Jurassic-Pork @jmarcelino I tried it, and as far as I can see the result is the same.
  • Downgrade SiPy firmware

    SiPy sipy sipy firmware sipy downgrade
    6
    0 Votes
    6 Posts
    2k Views
    S
    @livius As previous I intend SiPy-1.6.7.b1.tar I can post you the entire code, but this could be used only with our device connected to the UART serial port. Anyway, I post you the code used to handle sockets, because I suspect that the issue could be related to this task: import _thread import tracingfunction import time import socket import pycom # Global array for rx data from serial port SerialRxPacketsLock = _thread.allocate_lock() # this value define the max number of parallel socket! # Don't configure a value grather than the maximum allowable connections # on uart device!! (see the define MAX_SOCK_NUM in the uart device project) MaxNumActiveSockets = 6 # this arry is used by the task serialport to request a close on the relative socket KillRequestSocketList = bytearray(MaxNumActiveSockets) # this mutex is used to avoid thread conflicts in th access of the list of packets and socket SocketListLock = _thread.allocate_lock() # list of packets that must be sent on a particular socket rxPacketsFromSerialPortList = [] # list of enabled sockets socketList = [] # list of id related to the socket! socketUniqueIdList = bytearray(MaxNumActiveSockets) pycom.heartbeat(False) currentRGBLed = 0x007f00 # this function return the number of current active sockets def GetNumOfActiveSocketList(): global SocketListLock global socketList global MaxNumActiveSockets idx=0 totalActiveSocket=0 SocketListLock.acquire() while(idx<MaxNumActiveSockets): if(socketList[idx]!=None): totalActiveSocket=totalActiveSocket + 1 idx = idx + 1 SocketListLock.release() return totalActiveSocket # this function return the position of the first free socket slot def ObtainSocketListPosition(): global SocketListLock global MaxNumActiveSockets idx=0 SocketListLock.acquire() while(idx<MaxNumActiveSockets): if(socketList[idx]==None): break idx = idx + 1 if(idx==MaxNumActiveSockets): idx=-1 SocketListLock.release() return idx def toggleRGBLed(): global currentRGBLed if(currentRGBLed==0x007f00): currentRGBLed=0 else: currentRGBLed=0x007f00 pycom.rgbled(currentRGBLed) # socketThread # This task is responsible to handle data from/to the socket # ------------------------------------------------------------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------------------------------------------------------------ def socketThread(voidPar): import stuffingfunctions global socketList global SerialRxPacketsLock global rxPacketsFromSerialPortList global KillRequestSocketList # we print on the terminal that the thread started print ("socketThread Started") # set counters and ids to zero idxSocketToCheck = 0 aliveCounter = 0 pycom.rgbled(0x00007f) # infinite loop! while True: # increase the alive counter aliveCounter = aliveCounter + 1 # if the alive counter reachs 15000, print on the # terminal that this thread is alive if(aliveCounter>15000): aliveCounter = 0 print("socketThread alive!!") # assign the thread socket position threadIdPos = idxSocketToCheck # if there is a kill request, the buffer is empty and the socket is valid, close the socket if(KillRequestSocketList[threadIdPos]==1) and (socketList[threadIdPos]!=None) and (rxPacketsFromSerialPortList[threadIdPos]==None): socketList[threadIdPos].close() socketList[threadIdPos]=None KillRequestSocketList[threadIdPos]=0 print("Socket " + str(threadIdPos) + " killed!") # acquire the mutex SerialRxPacketsLock.acquire() if (socketList[threadIdPos]!=None): # if the current socket is alive if(rxPacketsFromSerialPortList[threadIdPos]==None): # if there is no data to send, do nothing pass else: # if there is data to send, try to send it try: print("Writing data into socket " + str(threadIdPos)) socketList[threadIdPos].send(rxPacketsFromSerialPortList[threadIdPos]) print("Write data ok") rxPacketsFromSerialPortList[threadIdPos]=None toggleRGBLed() # pycom.rgbled(0x007f00) except: # in case of exception, trace on file and close the socket print("Exception sending data " + str(threadIdPos)) tracingfunction.TraceLine("Exception sending data to the socket!") socketList[threadIdPos].close() socketList[threadIdPos]=None stuffingfunctions.WriteStuffingSerialPort(None, 0,threadIdPos, 1, socketUniqueIdList[threadIdPos]) rxPacketsFromSerialPortList[threadIdPos]=None else: # if the current socket is not alive, drop the data... rxPacketsFromSerialPortList[threadIdPos]=None # release the mutex SerialRxPacketsLock.release() if (socketList[threadIdPos]!=None): # if the current socket is alive # set partialData to None partialData=None while True: try: data=None #Receiving from client data = socketList[threadIdPos].recv(1460) if not data: # if we have not received anitying if (partialData!=None): # in this case, if we have partial data != none, the data is only in the partialData array data=partialData print("Received data from socket " + str(threadIdPos) + " Len: " + str(len(data))) stuffingfunctions.WriteStuffingSerialPort(data, len(data),threadIdPos, 0 , socketUniqueIdList[threadIdPos]) toggleRGBLed() # pycom.rgbled(0x00007f) break else: if(len(data)>0): # if we have received something if(len(data)==1024): # in this case, there are probably many bytes to read (python slices packets greather than 1024 in multiple packets) # we save this data in the partialData and we issue a new read request... partialData=data time.sleep(0.002) continue else: if (partialData!=None): # in this case, if we have partial data != none, we compose the full packet partialData = partialData + data data = partialData else: # in this case, the data is only in the data array pass # we pass the packet to the serial port! print("Received data from socket " + str(threadIdPos) + " Len: " + str(len(data))) stuffingfunctions.WriteStuffingSerialPort(data, len(data),threadIdPos, 0 , socketUniqueIdList[threadIdPos]) toggleRGBLed() # pycom.rgbled(0x00007f) break break except socket.timeout: if data: if(len(data)>0): # added 30/03/2017 10.17 -----> if (partialData!=None): # in this case, if we have partial data != none, we compose the full packet partialData = partialData + data data = partialData else: # in this case, the data is only in the data array pass # added 30/03/2017 10.17 <----- print("Received data from socket " + str(threadIdPos)) stuffingfunctions.WriteStuffingSerialPort(data, len(data),threadIdPos, 0 , socketUniqueIdList[threadIdPos]) toggleRGBLed() break except socket.error: # in case of error exception, we close the socket print("Closing socket thread " + str(threadIdPos)) if(socketList[threadIdPos]!=None): socketList[threadIdPos].close() socketList[threadIdPos]=None stuffingfunctions.WriteStuffingSerialPort(None, 0,threadIdPos, 1 , socketUniqueIdList[threadIdPos]) break # we increase the socket idx idxSocketToCheck = idxSocketToCheck + 1 # eache time we parse all sockets, we do a pause of 2 ms if idxSocketToCheck==MaxNumActiveSockets: idxSocketToCheck = 0 time.sleep(0.002) # we should never reach this point print ("ThreadRx " + str(threadIdPos) + " terminated!")
  • 0 Votes
    5 Posts
    2k Views
    S
    @jmarcelino Thank you. That's what I needed to know :)