• Atom Pymakr can't recognize usb to ttl module (CH340 chip)

    3
    2
    0 Votes
    3 Posts
    38 Views
    Gusti Made Arya WijayaG
    Ok, I see. I've tried that, and my ch340 can be recognized by Atom. Thanks, Gijs [image: 1607669569766-aca47264-6b68-4eab-9bd8-97982e225cab-image.png]
  • encode Vs struct

    4
    0 Votes
    4 Posts
    53 Views
    robert-hhR
    @kjm That's a good way doing it. As a matter of preference & PEP8 coding style I would write it as: import struct slot = 15 rtu = 14 slotrtu = (slot & 0x0f) | (rtu << 4) packet = struct.pack('B', slotrtu) Using binary operators instead of arithmetic ones results in the same value but expresses more clearly the intention. And using slot & 0x0f is more a 'belt and straps' attitude. The only important change is using B instead of b, indicating that the number is unsigned, which however mostly matters on unpack.
  • Pygate w/ POE Adapter - PLC Ethernet Communication

    2
    0 Votes
    2 Posts
    44 Views
    G
    Hi, My experience with PLC's of this fashion is not at a level from which I can comfortably give you an expert opinion. Though I can inform you about the micropython ethernet library. Essentially, it integrates the lwIP stack we use in WLAN and LTE as well, through the SPI-enabled ethernet controller on the PyEthernet. From what I know, it is not possible to use the same stack on the different interfaces (for example, Ethernet and LTE) at the same time, or at least, differentiate between the interfaces.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • Upload Code or Project with external USB to UART Interface

    3
    0 Votes
    3 Posts
    47 Views
    rcolisteteR
    I recommend rshell, screen (Linux), ampy and Thonny.
  • wifi antenna default

    6
    0 Votes
    6 Posts
    79 Views
    G
    I will add an entry to the documentation and a micropython constant for MAN_ANT to make this more clear, thanks!
  • Ways of doing things.

    4
    0 Votes
    4 Posts
    67 Views
    J
    @kjm nope, quite the contrary, there is explicitly no listen-before-talk (LBT) in the LoRaWAN spec (at least in the EU region, not too sure about the others). In the EU region LBT-AFA would allow increased airtime, but they chose not to implement that, don’t know why. Probably to make the node as simple as possible and reduce power consumption. IIRC on the LoPy, raw LoRa actually uses LBT. Note that given the distances covered by LoRa, LBT does not guarantee absence of collisions. A gateway could hear both nodes A and B while the two nodes can’t hear each other, so A could think the channel is free when B is sending. I believe LoRaWAN class B included some form of beaconing for sync but I’m not sure of the details and I don’t think this is widely implemented on either devices, gateways or LNS.
  • Corner Cases

    2
    0 Votes
    2 Posts
    15 Views
    robert-hhR
    @kjm The time is a little bit longer, since it is the span between i being 3 and the moment, the command string "AT^RESET" is finally parsed & executed by the modem firmware. Since that event is relatively rare, it may happen in that time.
  • How to improve my LORA-based project?

    1
    0 Votes
    1 Posts
    22 Views
    No one has replied
  • IEEE 802.11ah?

    2
    0 Votes
    2 Posts
    30 Views
    G
    Hi, Unfortunately I do not think it is in our plans to add this anytime soon. Gijs
  • Working with I2C and port expander

    1
    0 Votes
    1 Posts
    22 Views
    No one has replied
  • Advice to speed up write to SD card file - Datalogger

    4
    0 Votes
    4 Posts
    53 Views
    J
    @robert-hh thanks for your suggestion. I have attempted to improve the minimum sapling frequency, by keeping the file open if the desired sampling freq < 100ms. Unfortunately, if I set the delta time to 50ms (updating the interrupt in via a IOT feed) the time between samples is still excessive at 90ms. If I comment out the write operation so that the function isnt actually writing to sd, then the min delta T becomes 65ms (still long). I have found however that the bulk of this is due to the time to collect the variables (28 class attributes) and the convert to strings & concatenate. def log(dTms): global last_time_ms global file_open_status global f if sd_mounted: if data_file_version == 0: setup_log_file() last_time_ms = chrono3.read_ms() timenow_ms = chrono3.read_ms() timenow_s = timenow_ms/1000 ADC_mV_str = ",".join(str(inst.mV_val_WMAfilt) for inst in ADCInput._ADCregistry[1:]) ADC_engval_str = ",".join(str(inst.engineering_val) for inst in ADCInput._ADCregistry[1:]) Output_str = ",".join(str(inst.desired_duty_perc) for inst in output_class._Outregistry[1:]) CAN_str = ",".join(str(inst.engineering_value) for inst in CANSPN._registry[0:]) if dTms >= 100: # non-volatile mode if samp freq <10Hz (closes file each time) if file_open_status: f.close # this closes the file as switching from high samp freq to slow/non volatile mode file_open_status = False with open('/sd/data_log_%s.csv' % data_file_version,'a') as f: f.write(str(timenow_ms)+","+str(timenow_s)+","+str(timenow_ms-last_time_ms)+","+ADC_mV_str+","+ADC_engval_str+","+Output_str+","+CAN_str +"\n") else: # volatile mode which keeps file open between logs in high freq use cases if not file_open_status: f = open('/sd/data_log_%s.csv' % data_file_version,'a') file_open_status = True f.write(str(timenow_ms)+","+str(timenow_s)+","+str(timenow_ms-last_time_ms)+","+ADC_mV_str+","+ADC_engval_str+","+Output_str+","+CAN_str +"\n") print(str(timenow_ms-last_time_ms)) last_time_ms = timenow_ms else: print("cannot log data, SD card not mounted succesfully on boot!") Could you advise if my approach of collecting my variables from class instance attributes from other modules is slow practice? I cannot see a more suitable approach since I want to access many variables within multiple modules. Kind regards
  • PyGate - Temperature and power consumption

    7
    2 Votes
    7 Posts
    147 Views
    M
    @Clemens @kodarn have a look at my repo :) https://github.com/maxklt/lte-pygate
  • How to read pinout diagram ?

    4
    0 Votes
    4 Posts
    46 Views
    G
    Right, the Serial connections can be used for UART communication on TX and RX. We use UART0 (Pin 1 and Pin 2) for uploading new code to the device, and you are free to use UART1 and UART2 for other purposes (if you have a Fipy, UART2 will be used for the LTE modem)
  • 10 Year Battery Life?

    12
    0 Votes
    12 Posts
    136 Views
    rcolisteteR
    Pyboard's (v1.1/Lite/D SF2/3/6) has boot time about tens of ms instead of hundreds of ms of ESP32. Even for Pyboard's slower than ESP32. I'm about to measure boot time on nRF MCU's. About RAM : even 16 kB of BBC Micro:bit allows to do a lot of things in MicroPython, by using optimised software (drivers for low memory usage, etc), etc. For example, I've ported ulab module for BBC micro:bit, not yet published because I need to optimise the workflow for changing some source code files, then I've tested FFT for 512 float point numbers ! So 64 kB on nRF52832 or STM32WLE5, with a well developed MicroPython firmware and good practices, could be enough for many LoRa(Wan) node applications. Obviously some applications need a lot (even 1-2 MB) of RAM, so there is always a need of 'super-microcontrollers' for intensive Edge Computing, etc.
  • 3V3 pins

    3
    1 Votes
    3 Posts
    31 Views
    K
    thanks , that clarifies all :)
  • How to read the response from HTTP post

    5
    0 Votes
    5 Posts
    81 Views
    S
    @Mao said in How to read the response from HTTP post: I'm using an updated urequests lib including the "encode_basic_auth" function, although I don't think this results in the error. Hello Mao, can you tell me, where you found a urequests lib with a function for basic auth, which works? I need that for my project. Kind regards, SciWax
  • Challenge: pycom reference app - gps lte logger

    2
    0 Votes
    2 Posts
    21 Views
    G
    Hi, Thanks for the challenge! :) I like the requirements you set out and once I have some spare time, Ill take a look at working this out!
  • 0 Votes
    2 Posts
    23 Views
    G
    Hi, Can you privately message me your WLAN MAC address? We will get it sorted for you! Gijs
  • servo burning out a WiPY3?

    3
    0 Votes
    3 Posts
    26 Views
    robert-hhR
    @PyDrew That could be caused by the servo connected to the same 5V power supply as the WiPy. The servo can cause high energy high voltage spikes on the power supply line when switched off which cannot be suppressed by the power regulator. The maximum input voltage of the WiPy Vin pin is 6V. Any voltage beyond that will kill the regulator. So the best is to use different supplies for the Servo and the Wipy. On option you have to salvage the WiPy is to either replace the LM3281 power regulator (difficult), or just to remove it from the board (easy) and supply the WiPy though the 3.3V Pin. That might be even possible from the 5V supply for Servo, if you use a 3.3V regulator which can withstand higher input voltages, like a LD1117 plus spike filtering.

Pycom on Twitter