@Nca78 I feared that might be the case. my task for today was to dig up my st-link and try that, though I hoped I might have done something wrong and the cp2102 can be used to program and not just debug.
That module is pretty cheap and from what I see with the naked eye, you can disconnect the cp2102 with the jumpers so the power consumption might actually be good enough to use as-is.
I'll report back to let you know once I've succeeded
idanronen
@idanronen
Best posts made by idanronen
-
RE: GUIDE - NRF5 / NRF51 / NRF52 for beginners
-
RE: Wireless remote door lock - HW choices
@nagelc From what i've read on the forums, it seems pretty clear that if a pro mini was my choice i should go for the 3.3v variant, as the power draw is lower, its just that i then came up on the STM8/32 options and got thrown off. since i can enable the boost converter to 5V for the motor just when i need the motor, i think that offsets the benefits of using just 1 regulator to 5V for both the pro mini (5v variant) and the motor.
What im trying to do is mainly get it to work with the lowest possible current draw and most efficient power source so i dont have to replace/charge it every month. for example lithium is more energy dense than alkaline, but if the power conversion takes a lot more that kinda negates the benefits. -
RE: 💬 MySensors Battery Relay
Thanks for sharing. How did you get low current while still checking messages frequently enough? Or do you only check for messages every hour or so?
-
RE: Polish your crystal ball: best mcu/radio successor chips?
@NeverDie I'm not sure the amount of customization each stm32 version/core requires, but my limited experience with the blue pill wasn't that bad in terms of finding support for basic interfaces.
In the end (IMO), community support is everything, and whether stm, notrdic, or a Chinese clone of one of those takes the main stage is up to how friendly the SDK is, and what gets ported quicker to arduino.
Latest posts made by idanronen
-
RE: Polish your crystal ball: best mcu/radio successor chips?
@NeverDie I'm not sure the amount of customization each stm32 version/core requires, but my limited experience with the blue pill wasn't that bad in terms of finding support for basic interfaces.
In the end (IMO), community support is everything, and whether stm, notrdic, or a Chinese clone of one of those takes the main stage is up to how friendly the SDK is, and what gets ported quicker to arduino.
-
RE: ESP-NOW
@idanronen It sounds like you've found the set of tradeoffs that you like.
https://forum.mysensors.org/topic/11933/best-mcu-radio-successor-chips
Yes and no. I'm fine with the lolin32 lite for a couple of bucks for most things, especially solar. For example I've made several units of esp-now capacitive soil moisture sensors with it. When solar is involved, the 2mah extra per day are a non-issue. However a general purpose circuit like the one I mentioned could be very useful for simplifying cases where you need to also turn off all external sensors and peripherals, or use other MCU such as an esp32-C3 or one of the seeed ones like the rp2040 Xiao.
I keep an eye out for ready made low power circuits or boards on AliExpress, but it doesn't look like the Chinese are up to speed on low power consumer grade circuits. -
RE: ESP-NOW
@NeverDie yes, however at 20uA quiescent and 5$ I'd rather just buy a firebeetle for 1$ more and have 10uA sleep
-
RE: ESP-NOW
@NeverDie That sounds like a really nice idea. Since most of my project are 1 off, I don't have experience with designing pcbs or working with such small package components. If anyone ever designs a general purpose board with a tpl5010, a resistor for the timer, a mosfet, feedback from the mcu to latch the mosfet or signal the timer the work is done, and maybe even an optional spot for a low quiescent LDO regulator like the ht7333, me6211, or mcp1700, capacitors, and a manual override for a button or sensor interrupt, I would love if you could share it. I'm sure such a board could be useful for many MCUs.
As for the data rates, I've never measured, nor would I get the maximum speed even if I did, since I'll never be that close to the router with a clear line of sight. Either way I wouldn't choose the highest bitrates even if I were, as there are maybe a handful of use cases (like the esp-cam), and the drawback of reduced reliability and range at those rates. Esp-now long range mode seems like a better use case overall.
That being said, in a non sterile environment (in terms of 2.4ghz noise), and the distance they've mentioned, 1MBps (8mbps) out of the possible 54mbps sounds right to me for real life speed. -
RE: ESP-NOW
@NeverDie The DFRobot FireBeetle (ESP32) has around 10ua deep sleep current, can be flashed by USB, can be run directly from a lithium ion battery, has a charging circuit, and only costs ~6$.
The lolin32 lite has 70-90ua deep sleep current and the same peripherals for ~2.3$ and is the one I'm personally using.
I'm actually working on writing a dedicated ESP-NOW to HA TCP gateway (instead of the plethora of available MQTT ones). If Mysensors supported ESP-NOW it would be considerably better and more secure.
As for the sleep circuit you mentioned, do you mean a MOSFET connected to a sensor/button and an MCU pin to latch it on?
Right now i'm also trying to implement a low power remotely activated node with an external BLE tag circuit wakeup or an external RF433 "key finder" circuit wakeup (~70ua). -
RE: Looks as though ESP-NOW is finally working...
@NeverDie I see. I know I'm a minority with this, but I really prefer to add an external circuit for waking up a generic mass produced board, rather than designing an entirely new board (as I'm not proficient with that).
-
RE: Looks as though ESP-NOW is finally working...
@NeverDie not sure what you mean by "finally working" as it has been working for a few years. Do you mean it's now supported by mysensors?
If you're following Andreas spiess on YouTube, he's been doing some comparisons recently with different esp32 boards and documenting their operating current, sleep current, chargers/regulators, and some other interesting information. Some relatively cheap Chinese boards show promise IMO with a few dozen uA in deep sleep.
Either way, like you said, you can power the entire circuit off with a mosfet or something and wake up from your sensor. I'd actually love to see a proper circuit like this, as I'm less savvy than most here with electrical engineering, and after seeing a few of those I have no idea which would be better. -
RE: GUIDE - NRF5 / NRF51 / NRF52 for beginners
@BearWithBeard said in GUIDE - NRF5 / NRF51 / NRF52 for beginners:
I just got my first NRF5 running. I'll note how I got it working in case any of you guys still have troubles:
Setup
- OS: Windows 10
- Programmer: STM32 Blue Pill with the Black Magic Probe firmware
- NRF5: EByte E73-TBB dev board with a E73-2G4M0S1B (NRF52832)
- Environment: PlatformIO
Instructions
Load the Black Magic Probe firmware with
stlink
as the probe host onto Blue Pill. You can follow this guide.Connect your new BMP to the NRF52 module:
BMP NRF52 Serial Port 3V3 3V3 GND GND A5 SWDCLK GDB Server B14 SWDIO GBD Server A2 TX UART A3 RX UART Note: A2 and A3 are not required for programming. This is how you'd wire up the BMP for "classic" serial debugging. You can use the BMP both for programming and serial communication - no need for a second FTDI module.
Using the GNU Arm Embedded Toolchain, run
arm-none-eabi-gdb
in a console and enter the following commands to unlock the NRF52:target extended-remote BMP_GDB_SERVER_PORT mon swdp_scan attach N // N = number of "Nordic nRF52 Access Port" if there are several mon erase_mass detach
From the two serial ports the BMP provides, you want to use the GDB Server for
BMP_GDB_SERVER_PORT
above. If Windows only provides generic names for both ("USB Serial Device" or something), the one with the lower number should (usually) be the right choice. If not, try the other one.Windows users also must prefix the port with
\\.\
if the number is double-digit, e.g.\\.\COM13
.Now you can start uploading sketches the usual way. Here's my minimal PlatformIO config:
[env:nrf52_dk] platform = nordicnrf52 board = nrf52_dk board_build.variant = generic framework = arduino upload_protocol = blackmagic lib_deps = 548 ; MySensors
And a minimal test sketch for MySensors:
#include <Arduino.h> #define LED 17 #define MY_RADIO_RF24 #define MY_RADIO_NRF5_ESB #define MY_NODE_ID 182 #define SKETCH_NAME "NRF52 Test" #define SKETCH_VERSION "0.1" #include <MySensors.h> #define CHILD_ID 1 MyMessage msg(CHILD_ID, V_VAR1); void presentation() { sendSketchInfo(SKETCH_NAME, SKETCH_VERSION); present(CHILD_ID, S_CUSTOM); } void setup() { pinMode(LED, OUTPUT); } void loop() { static uint8_t num; send(msg.set(num)); ++num; digitalWrite(LED, HIGH); wait(5000); digitalWrite(LED, LOW); wait(5000); }
Works like a charm so far! Now, if you please excuse me, I have a whole new microprocessor family to explore. Fun times!
For the life of me i cant figure out if im making the BlackMagic properly. I'm moving the boot0 jumper to 1, flashing the 8kb maple (usb flash) DFU file using the st-link application on windows.
I move the jumper back to 0, and connect using the micro usb, and i can flash code normally using arudino IDE using the STM32duino bootloader (and if i do so, i see the device communication on a new COM port).
From there i cant get anything from these guides to work. the windows STM "flash demonstrator" app doesnt recognize the device, and i dont have a linux machine available at the moment for the dfu-util (and Ubuntu shell on windows wont recognize the usb device). When i try to flash the blackmagic.bin starting at 0x08002000 using the ST-link software it shows it succeeded, but when i return the jumper to 0 and reset the device, this is what i get:
The 2 new COM ports appear (COM12,COM13), but i cant seem to flash anything successfully.
I've installed the GNU arm toolchain for windows and tried "target extended-remote \.\COM13" (12 just gets stuck on nothing), and i get:
-
RE: GUIDE - NRF5 / NRF51 / NRF52 for beginners
Im not sure my flashing with the blackmagic even does anything. The console is unclear:
Sketch uses 3556 bytes (0%) of program storage space. Maximum is 409600 bytes. Remote debugging using \\.\COM11 Target voltage: ABSENT! Available Targets: No. Att Driver 1 Nordic nRF52 M3/M4 2 Nordic nRF52 Access Port Attaching to Remote target 0xfffffffe in ?? () Reading symbols from nrf1.ino.elf...done. Loading section .text, size 0xde4 lma 0x1c000 Loading section .ARM.exidx, size 0x8 lma 0x1cde4 Loading section .data, size 0x78 lma 0x1cdec Start address 0x1c578, load size 3684 Transfer rate: 33 KB/sec, 614 bytes/write. Temporary breakpoint 1 at 0x1cb8c: file C:\Users\....\AppData\Local\Arduino15\packages\sandeepmistry\hardware\nRF5\0.6.0\cores\nRF5\main.cpp, line 28. Starting program: C:\Users\....\AppData\Local\Temp\arduino_build_366086\nrf1.ino.elf Note: automatically using hardware breakpoints for read-only addresses. Program received signal SIGSEGV, Segmentation fault. 0x00000000 in ?? () Program complete!
and i dont see any serial debug information
-
RE: GUIDE - NRF5 / NRF51 / NRF52 for beginners
@ncollins I've been working on turning an stm32f030f4p6 into a blackmagic probe for a few days now. Hit a wall when the compiled firmware came out to 83kb which is over the 64kb on board. Found someone who shrunk it down so it'd fit, and someone claiming it has another 64kb which can be unlocked. I'm just looking for the patience to get back in there, as this whole thing has been a major ordeal