Ebiroll / RAK811_BreakBoard

RAK811_BreakBoard for platformio from https://github.com/RAKWireless/RAK811_BreakBoard
23 stars 10 forks source link

Possible to Change this project for WisNode-Lora? #5

Open verofin opened 6 years ago

verofin commented 6 years ago

Hi Ebiroll Thanks for your great effort on this project. I would like to know if it is possible and how I could go about changing this project for RAK WisNode-Lora. Its using the same RAK811 and STM32 chip set. It's just the board layout that's different. Thanks for your response

Ebiroll commented 6 years ago

Hello @verofin . I have used it on the WisNode-Lora. Just remove the init() calls to the GpsInit() and LIS3DH_Init( ); in the function BoardInitPeriph() located in src/RAK811BreakBoard/board.c Then you will have to find something else to send in PrepareTxFrame() in src/main.c GL

Ebiroll commented 6 years ago

Also this schematic might be helpful. https://github.com/Ebiroll/beer_tracker/blob/master/RAK-wisnode/wisnode-lora_schematic_diagram.pdf

verofin commented 6 years ago

Thanks I will try it. I recompiled the app using pio run and found allot of warnings. When I program my Tracker Board I don't seem to get a response. Is there a blinky app to make sure I didn't kill the board?

Ebiroll commented 6 years ago

In the end of src/main.c you have a blinky app. Just rename the other main(). Unless you overwrote the bootloader I dont think you ruined your board. And if you did you can probably flash a new bootloader by using the SWD pins. https://github.com/Ebiroll/esp32_blackmagic. Maybe you just forgot to move the strap after flashing. P1. Boot Switch Pin,

verofin commented 6 years ago

Is there a better form in which to have these discussions?

I stripped out the whole program in an attempt to get the LED's to blink. I don't think the bootloaded was overridden. It seems to write the bin from 0x08000000. Do you know what the entrypoint for the application is? The output from running stm32flash from my ununtu pc is: stm32flash /dev/ttyUSB0 -e 0 -w .pioenvs/rak811/firmware.bin stm32flash 0.5

http://stm32flash.sourceforge.net/

Using Parser : Raw BINARY Interface serial_posix: 57600 8E1 Version : 0x31

Option 1 : 0x00 Option 2 : 0x00 Device ID : 0x0429 (STM32L1xxx6(8/B)A)

Ebiroll commented 6 years ago

Are you using the Trackerboard or the WisNode-Lora? The blinky app only works on the Breakboard/tracker board.

On the wisnode I did some change in src/peripherals/lis3dh.c In the init function I did this. //return 0;

I use screen to check serial output. Press reset after starting screen. screen /dev/ttyUSB0 115200 Also check pio --version more ~/.platformio/platforms/ststm32/platform.json

I used the flash application located in the stm32flash directory [olof@atrash RAK811_BreakBoard]$ ./stm32flash -w .pioenvs/rak811/firmware.bin /dev/ttyUSB0 stm32flash 0.5

http://stm32flash.sourceforge.net/

Using Parser : Raw BINARY Interface serial_posix: 115200 8E1 Version : 0x31 Option 1 : 0x00 Option 2 : 0x00 Device ID : 0x0429 (STM32L1xxx6(8/B)A)

LIS3DH no ack LIS3DH no ack LIS3DH no ack +++++++++++++++++++++++++++++++ RAK811 BreakBoard soft version: 1.0.2

Selected LoraWAN 1.0.2 Region: EU868

ABP: Dev_EUI: 60 XX XX XX DevAddr: 26011FDA NwkSKey: 79 XX XX XX XX AppSKey: DD XX XX XX XX XX XX GpsGetLatestGpsPositionDouble ret = 0

verofin commented 6 years ago

I use Ubuntu so I installed st32flash using apt-get. My PlatformIO, version 3.6.0a7

I'm using the tracker board v2.0 I also have a WisNode, but that's another story

I managed to compile the code a couple of days ago and had the tracker running, connected to ttn. Then I wanted to get the WisNode to work. When that did not succeed I thought I would see if I could at least recompile the Tracker software in an attempt to get back to some point where things worked. I managed to now have a tracker board with both led's on and nothing happening on the serial port. Is there a .bin I could burn to just make sure by board is still fine? How do I get back to a controllable state?

sabas1080 commented 6 years ago

STM32 you must have this patch https://github.com/Formlabs/stm32flash/commit/8c4aa650bffaf98e96d1b6065ab6e76c43150d8a

mapl commented 5 years ago

I also have the RAK WisNode. Would be nice having a separate project folder without the hassle to adopt code.

zdila commented 5 years ago

I can run it on my WisNode just by applying https://github.com/Ebiroll/RAK811_BreakBoard/issues/5#issuecomment-405612921. I use Debian Bullseye.

Flashing:

stm32flash -b 115200 -e 255 -w ~/RAK811_BreakBoard/.pio/build/rak811/firmware.bin -v /dev/ttyUSB0

Reading logs:

picocom --baud 115200 --omap crcrlf --echo /dev/ttyUSB0