TTGO T-Deer

Can you tell me which lmic repository you are planning to use?

Just did my first check with
lib_deps_lora = MCCI LoRaWAN LMIC library@^2.3.1

It seems everything is running fine - THX to

everything seems to work out of the box!

1 Like

Thanks. Yes, gotta have DIO1 connected to something or you only transmit once.

I see now that the device wants to join via OTAA (in my gateway traffic view) but my device doesn’t really do it and retries again and again.
I think this is now the point to dig deeper in the LMIC stuff…

It’s likely to be the DIO1 wiring, or config in your code - device is sending request, gateway is replying with confirmation but its not being picked up

I made the mistake to set Arduino Pro or Pro Mini in the Arduino IDE. Here you have to choose Arduino Mini. And then the upload works. Thanks.

UPDATE: If you enter the right DEVEUI and APPKEY the whole thing works like magic :man_facepalming:

1 Like

Did somebody get the serial flash working?

It works for me. I have to choose Arduino Mini in the Arduino IDE.

I’m talking about the W25Q32FVSS that is soldered on the board…
I tried the SerialFlash library but it seems I’m getting no connection to the flash…

#define FLASH_CS (8)

if (!SerialFlash.begin(FLASH_CS))
{
Serial.println(F(“Unable to access SPI Flash chip”));
}
else
{
FlashTest();
SerialFlash.sleep();
}

I managed to get “Start flash…Init Flash OK!”
Used SPIFlash library, must change device ID from 0xEF30 to 0xEF40

#include <SPIFlash.h>;
SPIFlash flash(8 , 0xEF40);

Serial.print("Start flash..."); 
if (flash.initialize())
   Serial.println("Init Flash OK!");
else
   Serial.println("Init Flash FAIL!");
Serial.print("DeviceID: ");
Serial.println(flash.readDeviceId(), HEX);
Serial.println();

Serial.println("Flash content:");
int counter = 0;
while(counter<=256){
    Serial.print(flash.readByte(counter++), HEX);
    Serial.print('.');
}    
Serial.println();

But I’ve not had chance to play or go beyond that, first step.

Start flash…Init Flash OK!
DeviceID: EF40

Flash content:
FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.FF.

Seems ok

Was not my best weekend it seems - a lot of stupid careless mistakes…
I used the SerialFlash library and sent the device to sleep. After re-booting you have to call wakeup, even if SerialFlash.begin(FLASH_CS) fails.

The positove message: removing the LED, sending flash, LORA and CPU to deepsleep I achieved a power consumption of ~0.07mA measured on the LiPo battery…

Just noticed my meter will do current down to uA so gave it a try.

Powering the device (with led) on LiPo via the LDO, running standard code with sleep etc I am getting 0.84mA in sleep period

UPDATE

As per schallb I took the red led off (I got brave) and we are down to a very usable 78uA is sleep - no red led

tl/dr;
it’s IO1 (as labelled on the board) which should be connected to D5 for the above mentioned pin mapping, right?

long version:
oh well… expected this to be easier… :roll_eyes:

hooked one up to an 3.3V FTDI, seeing the demo sketch’s data coming in fine, looking good…

so let’s flash the OTTA demo, you guys suggested the MCCI lib (platformio #5774)

AVRdude can’t seem to connect - oh well, like in the old days, push the reset button on the board at the right moment - or connect DTR (aka RTS) from the FTDI-cable… ok. flash succeeded.

but it’s only rubbish coming back in the serial monitor, though it’s definitly set to 9600 baud like set up in the sketch. maybe 115200? no. 19200? yes! … why? no idea. platformio.ini as well as the sketch itself has it defined as 9600…

checking the gateway… nothing coming in. doh! the lib is set to 915mhz (need to edit /project_config/lmic_project_config.h for 868 or others)

clean/upload - hurray - JOIN ACCEPTs in the gateway’s console… but board obviously not recognizing it… yes - IO1 connected to D5 using and @jezd’s pin mapping
so why? :roll_eyes:

well, the devil’s in the detail.

i did have
board = pro8MHzatmega328
defined, this doesn’t work.

using
board = pro16MHzatmega328
does.

:woman_shrugging:

that’s running it as pro16MHzatmega328 and using rocketscream’s low-power for sleep as in your platformio.ini above?

My first set of five devices is up and running.
Next steps will be to imlement downlink functionality and better support for wakeup from deep-sleep via external interrupt.
One thing i found out: the W25Q32 SPI flash offers a unique 64bit wide ID! It can perfectly be used as DEVEUI

2 Likes

Any code you feel like sharing - I’m having issues with the 16mhz aspect and running at 8mhz, have you done a new bootloader?

No new bootloader -> I boot with 16MHz and switch asap to 8Mhz (clock divider)

platformio.ini:
[env:ttgotdeer]
platform = atmelavr
framework = arduino
board = pro16MHzatmega328
upload_speed = 115200
monitor_speed = 9600
board_build.mcu = atmega328p
board_build.f_cpu = 8000000L

in my code:
void setup()
{
//set to 8MHz
setClockPrescaler(CLOCK_PRESCALER_2);
}

using prescaler.h from https://github.com/fschaefer/Prescaler

1 Like

New Deer Promini_LORA_V02 board has appeared :smile:

Charging led has changed to red I think, need circuit layout to see what has changed - there has been a big shuffle around on the board (is it really still 16mhz ?). No jumper option for 5v/3v operation anymore, so if its 3v then is it 8mhz now?

Aliexpress shows board images plus old board too, I suspect the spec listing needs an update - interesting if the have listened to feedback.