• Issue when running the code

    sipy pymakr connect
    2
    0 Votes
    2 Posts
    1k Views
    L
    @Smartpills Pymakr or Atom Pymakr plugin? If Pymakr - then do not use it at all. https://forum.pycom.io/topic/1026/pymakr-atom-plugin-released
  • Send email via gmail smtp

    smtp
    3
    0 Votes
    3 Posts
    1k Views
    P
    @pmulvey OOps! I was dabbling with the Linkit smart 7688 duo and also dabbling with Python 3 on the laptop and I think that I got confused. Yes I did send emails from Python 3 on the laptop but didn't actually do it on the Linkit smart 7688 duo. From looking around it appears that there is no SMTP module for MicroPython... or is there??
  • Soft reboot crashes

    soft reset
    6
    0 Votes
    6 Posts
    2k Views
    P
    @robert-hh (sysname='SiPy', nodename='SiPy', release='1.6.12.b1', version='v1.8.6-593-g8e4ed0fa on 2017-04-12', machine='SiPy with ESP32', sigfox='1.0.1') Looking good Robert, behaving OK now, will do more tests. I must experiment with not connecting to the LAN if it is already connected as this takes a few seconds. Thank you for your time and advice. Paul
  • Strange FTP behaviour

    ftp
    2
    0 Votes
    2 Posts
    1k Views
    robert-hhR
    @pmulvey FTP on Windows is pretty outdated and restricted. And it does not support passive mode. That's why LIST fails, and you cannot transfer any files. Use Filezilla or the FireFTP extension of Firefox.
  • Downgrade SiPy firmware

    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!")
  • COMMUNICATION BY RS232

    sipy pymakr uart
    2
    0 Votes
    2 Posts
    1k Views
    L
    @julian-cifuentes look here it is simple https://docs.pycom.io/pycom_esp32/library/machine.UART.html and connect RX and TX to pins like in datasheet https://docs.pycom.io/pycom_esp32/pycom_esp32/datasheets.html RX to TX TX to RX and GND
  • 0 Votes
    6 Posts
    2k Views
    L
    @jmarcelino created https://github.com/pycom/pycom-micropython-sigfox/issues/1 and also pull https://github.com/pycom/pycom-micropython-sigfox/pull/2
  • Arduino > Sipy

    arduino sipy sigfox
    5
    0 Votes
    5 Posts
    2k Views
    J
    @jcleloup Yes, correct. The SiPy is not just a modem, it's also microcontroller and many times more powerful than the Arduino
  • SigFox Error

    sipy sigfox
    16
    0 Votes
    16 Posts
    5k Views
    S
    @jmarcelino There u go the WIFI Autoconnect was still on !!!!! Now it works. Thank you guys !!!!!!!
  • Code stuck using sigfox with I2C sensor

    sigfox i2c sipy
    1
    0 Votes
    1 Posts
    948 Views
    No one has replied
  • Issues with UART(1) Port

    sipy
    2
    0 Votes
    2 Posts
    1k Views
    L
    @souldrone Do not use Pymakr it is unsupported - wait for plugin arrival. Now use e.g. Arduino IDE -> COM port monitor or Putty to read/write UART repl.
  • SSL Connection IPProto_SEC Error SiPy

    Moved websocket sipy
    5
    0 Votes
    5 Posts
    2k Views
    L
    @livius Did a quick try. Got the following error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/flash/lib/urequests.py", line 141, in urlopen File "/flash/lib/urequests.py", line 38, in __init__ OSError: -32512 Will look more into it later, but as fare as I can Google it might have something to do with the antenna transmission.
  • Raw socket on WiFi

    wifi raw socket custom ip packe
    2
    0 Votes
    2 Posts
    1k Views
    No one has replied
  • Sipy going crazy over the serial port something says Core Dump

    sipy
    8
    0 Votes
    8 Posts
    2k Views
    D
    @iotmaker, I'll have to check, the reason is not obvious, I'll keep you posted.
  • SiPy private networking

    sipy sigfox lopy lorawan
    4
    0 Votes
    4 Posts
    2k Views
    B
    @yunushkin88 You can expect 8 to 10 Km max with line of sight between two SiPy devices. You will expect to see increased range between a SiPy and the Sigfox network as the modulation protocol is different (BPSK). Hope this helps!
  • sigfox payload formatting

    sipy bytes
    5
    0 Votes
    5 Posts
    2k Views
    I
    @livius said in sigfox payload formatting: @iotmaker you can simply convert it b=[int(x, 16) for x in payload] but question is how do you got this payload? on first you have '0x11' but on last '4e' without 0x ? That worked... did some modification and now we are good. thank you
  • How does socket.recv(bufsize) work?

    sigfox sipy
    10
    0 Votes
    10 Posts
    4k Views
    B
    @Paolo-Prado Sorry - you're right the downlink is confusingly called "BIDIR" - Have a look at this link for an example of how to get a payload from a server using the downlink https://github.com/nicolsc/sigfox-downlink
  • 0 Votes
    7 Posts
    2k Views
    I
    @maku said in Pymakr having issue with SiPy (Could not enter friendly repl. (click to attempt to reconnect)): @iotmaker never used atom. You have plugin that can handle ftp transfer or are you using an external ftp client? Just use Filezilla as ftp client you can have the ftp client connected and the serial port running at the same time... after transferring the file via ftp, just do a reset via serial port commands
  • DSB1820 Onewire sensor on SiPy

    Moved sipy pymakr onewire ds18b20
    18
    0 Votes
    18 Posts
    5k Views
    L
    @sk Is this what you downloaded from board or what you have on the computer? Previously (for me still - however less than before) there are some corruption of files stored on the board. try something like this f = open('onewire.py', 'r+') d = f.readall() print(d) do you see some corruption in content? Try also downloading file throught ftp - is this file same as your on the computer?
  • SiPy Bluetooth

    Moved sipy bluetooth
    6
    0 Votes
    6 Posts
    2k Views
    S
    @jmarcelino is there any way to configure this? Any libraries or plug ins for the board's BT sensor I could use?

Pycom on Twitter