• CAN message decoding - how is data returned?

    3
    0 Votes
    3 Posts
    47 Views
    J
    To help others with this topic, the way I have extracted the engineering values is as per the below class method: def extract_value(self,data): bit_list = bin(int.from_bytes(data,"little"))[2:] packed_bit_str = zfill(bit_list,64) spn_relevant_str = packed_bit_str[(-1*(self.start_bit+self.msg_bits)):(-1*(self.start_bit))] self.engineering_value = ((int(spn_relevant_str, 2)) * self.scaling_factor) + self.offset I instantiate the class for each SPN, and for each PGN/msg the method is ran for all SPN's where the CAN ID matches the PGN ID. The reason for working in bits as opposed to bytes is that some messages dont take up a full byte or share bytes with other messages. I am new to Python and am in no way an experienced programmer, but though I would share my method since this didnt seem to be a commonly discussed topic.
  • main.py won't start after power up

    1
    1
    0 Votes
    1 Posts
    29 Views
    No one has replied
  • Error instantiating the SD module.

    3
    0 Votes
    3 Posts
    65 Views
    V
    @railmonitor Nothing changed though in my boot.py (which is empty) from one day to the next. However, I believe the internal machinations of the UART and the SD card modules are somehow stepping on each other's proverbial toes. I have sense gotten my experiment to work again, but I have no idea why it is working now and why it gave me those messages the other day.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    12 Views
    No one has replied
  • Pycom + Ethernet + webserver?

    3
    0 Votes
    3 Posts
    93 Views
    D
    Hello, I have the same problem, I need to add an Ethernet connection to my Wipy 3 what's the best solution: W5500, ENC28J60, USR-TCP232-S2 ? Best regards and stay Healthy Jiemde
  • rsa_encrypt

    1
    0 Votes
    1 Posts
    17 Views
    No one has replied
  • Assistance in Hardware Selection

    1
    0 Votes
    1 Posts
    30 Views
    No one has replied
  • FAT FS corrupted with leading FF ... FF in directory and files.

    2
    0 Votes
    2 Posts
    46 Views
    C
    please mind, that you have to wait to shutdown until all write operations are done. Sadly there is no flush feature, so you have to guess the timings and wait by your own. Normally only short messages are written. So a sleep of 1-2 seconds after the last write before a deepsleep will be secure. And don't forget to close the file, which also contains write operations.
  • Adding Modules

    library lopy
    3
    0 Votes
    3 Posts
    910 Views
    N
    @netskink the following command works for me though: import sys sys.path.append("/flash/test") import test_x @cpyree, the copy of the urequests forlder in /flash/lib is correct. May be, since the urequests forlder does not have _init_.py file, you need to import it as: import urequests.urequests as urequests urequests.get(...)
  • How to measure 12v signal?

    4
    0 Votes
    4 Posts
    41 Views
    N
    @sailorscott I haven't used the GPy myself but looking at the datasheet there are several GPIOs you should be able to use - with some of them you can set an internal pullup but others need you to add a pullup resistor between the pin and +3.3V - that's assuming of course that the input you are trying to read is either open-circuit or pulls the pin down to ground. You can use the same technique to read a float switch: just wire the switch in place of the optoisolator outputs in my previous description. I don't have a book recommendation off the top of my head but a web search for 'optoisolator tutorial' should get you started if you know the basics of how to use resistors, LEDs and transistors. If even that's still a bit new to you then a basic electronics course and/or book would be good - learn by playing with some cheap components before you risk frying your expensive GPy.
  • Wlan timeout error

    5
    0 Votes
    5 Posts
    189 Views
    J
    @jcaron said in Wlan timeout error: @j_mor Given the error message in your first post, I'd guess it would be TimeoutError? I thought that too, tried except TimeoutError: gave me "NameError: name 'TimeoutError' isn't defined" Also, you may want to add a second layer of security with a watchdog timer (WDT) so if ever things go bad and the board gets stuck it reboots after the given delay. IIRC it's not 100% foolproof, but every little helps. great idea, thank you
  • Rsa pycom

    2
    0 Votes
    2 Posts
    71 Views
    robert-hhR
    @mythael https://github.com/pycom/pycom-micropython-sigfox/blob/Dev/esp32/mods/moducrypto.c and https://github.com/pycom/pycom-esp-idf/tree/master/components/mbedtls/library
  • Clarification of Firmware upgrade process for Expansion Board 3.1

    1
    0 Votes
    1 Posts
    27 Views
    No one has replied
  • External Wi-Fi antenna

    2
    0 Votes
    2 Posts
    63 Views
    robert-hhR
    @dnbrk The antenna switch is a dedicated chip, connected to GPIO21. So yes, you can switch it using GPIO21. About the antenna, you have to look at the data sheet of the antenna you plan to use.
  • Detect FTP connection

    ftp fipy
    3
    0 Votes
    3 Posts
    304 Views
    D
    @misterlisty Would this work for you download a little semaphore file at the beginning of the ftp session have the scheduler check the semaphore file size and pause if it exists Perform the necessary ftp operations Download an empty file as the semaphore file so the scheduler can see that ftp is no longer in progress. (It would be nice if ftp supported a local delete of the semaphore file)
  • Bluetooth MAC to Sigfox

    2
    0 Votes
    2 Posts
    35 Views
    J
    @Cedric What's your use case? A tracker using BLE/WiFi instead of GPS? I suppose you want it to be battery powered? How long do you need it to last on batteries? Such a scheme would probably be quite power-hungry. Another (and probably more important) issue is bandwidth. The Sigfox payload is limited to 12 bytes per message and 140 messages per day. A BLE or WiFi MAC is 6 bytes, so you can send only 2 at a time (without any other info such as timestamp, which is probably not very useful anyway, or signal strength or anything). At best you can send 2 MAC addresses every 600 seconds (10 minutes) on average. It's common to have dozens of WiFi networks and BLE devices in range in dense areas, so either you need to filter out what you want to send, or it may take a while to send all of them and your update frequency will be much much lower than every 60 seconds. So yes, you can capture BLE and WiFi MAC addresses and send them over Sigfox, but there are inherent limits which may make it not worthwhile.
  • Running test on 100 wipy over a month

    wipy3.0 wdt
    4
    0 Votes
    4 Posts
    213 Views
    S
    Hi, again. I have update 10 wipy and 2 gpy with the latest fw (1.20.2.rc6). With this fw I'm getting Guru Meditation Error. Some times the pycom became freeze on the Guru Meditation Error. Guru Meditation Error: Core 1 panic'ed (InstrFetchProhibited). Exception was unhandled. Core 1 register dump: PC : 0x3ffb624c PS : 0x00060630 A0 : 0x80095188 A1 : 0x3ffdcc00 A2 : 0x3ffb61dc A3 : 0x00060620 A4 : 0x3ffdabe8 A5 : 0x00000001 A6 : 0x000000fe A7 : 0x00000001 A8 : 0x800947bc A9 : 0x3ffdcbf0 A10 : 0x00000000 A11 : 0x3ffc9509 A12 : 0x00060620 A13 : 0x00000001 A14 : 0x000000fe A15 : 0x3ffb61dc SAR : 0x00000000 EXCCAUSE: 0x00000014 EXCVADDR: 0x3ffb624c LBEG : 0x40091ad4 LEND : 0x40091b02 LCOUNT : 0xffffffff ELF file SHA256: ets Jun 8 2016 00:22:57 But most of the times the guru meditation error do a core dump, and the cpu reset. Guru Meditation Error: Core 1 panic'ed (StoreProhibited). Exception was unhandled. Core 1 register dump: PC : 0x40096c29 PS : 0x00060533 A0 : 0x80095107 A1 : 0x3ffdcc00 A2 : 0x3ffb61ec A3 : 0x00060520 A4 : 0x3ffdabe8 A5 : 0x00000001 A6 : 0x000000fe A7 : 0x00000001 A8 : 0x3ffb6210 A9 : 0x3ffb61fc A10 : 0x00000001 A11 : 0x0000abab A12 : 0x3ffdabe8 A13 : 0x00000001 A14 : 0x000000fe A15 : 0x3ffb61e4 SAR : 0x00000000 EXCCAUSE: 0x0000001d EXCVADDR: 0x00000009 LBEG : 0x40091ad4 LEND : 0x40091b02 LCOUNT : 0xffffffff ELF file SHA256: 0000000000000000000000000000000000000000000000000000000000000000 Backtrace: 0x40096c29:0x3ffdcc00 0x40095104:0x3ffdcc20 0x400f31b8:0x3ffdcc40 0x400e0715:0x3ffdccd0 ================= CORE DUMP START ================= This guru meditations are random. Can happen on the first 5 min or after 5 days.
  • urequests takes

    2
    0 Votes
    2 Posts
    134 Views
    K
    I've had no success with trying to timeout the urequests socket or running it in a separate thread, so for now I'm using wdt=machine.WDT(timeout=9*1000). Not the best solution but it stops the battery going flat while it hangs around waiting for failed connections.
  • 0 Votes
    1 Posts
    27 Views
    No one has replied
  • Pytest integration

    4
    0 Votes
    4 Posts
    58 Views
    S
    Thank you for the interesting informations, I want exaclty to be able to develop without having to load the software on the boards to test it. I'll look at your implementation, thank you for sharing! Best regards

Pycom on Twitter