Yeah, I hear that, but I’m told that it is possible to get the current down. There are posts on the forum to search for that could help.
The lowest I’ve got a Pico after altering the power is 900uA which is not good, so not really a battery powered option.
I am (literally) having nightmares with a node design at present due to the world wide shortage of MCU’s and radio modules. When (if) I come to any conclusions I’ll repost.
I finally got the Raspberry Pi Pico running but due to the decision to use CircuitPython the deep sleep mode is not (not yet, acc. to Adafruit) available. As Nick also stated, 900uA might be still to high for a battery powered node.
I have taken this from the Makerfabs Code and put it into the first USER CODE section:
#include <SPI.h>
#include "I2C_AHT10.h"
#include <Wire.h>
AHT10 humiditySensor;
int sensorPin = A2; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
int sensorPowerCtrlPin = 5;
void sensorPowerOn(void)
{
digitalWrite(sensorPowerCtrlPin, HIGH);//Sensor power on
}
void sensorPowerOff(void)
{
digitalWrite(sensorPowerCtrlPin, LOW);//Sensor power on
}
The next USER CODE Section seems to be my Problem Child. I don’t know how to get the Sensor data collected and prepared to be uploaded to the TTS:
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
//float humidity = 6.18;//dht.readHumidity();
// Read temperature as Celsius (the default)
sensorPowerOn();//
delay(100);
sensorValue = analogRead(sensorPin);
delay(200);
if (humiditySensor.available() == true)
{
//Get the new temperature and humidity value
temperature = humiditySensor.getTemperature();
humidity = humiditySensor.getHumidity();
//Print the results
Serial.print("Temperature: ");
Serial.print(temperature, 2);
Serial.print(" C\t");
Serial.print("Humidity: ");
Serial.print(humidity, 2);
Serial.println("% RH");
}
// Check if any reads failed and exit early (to try again).
if (isnan(humidity) || isnan(temperature)) {
Serial.println(F("Failed to read from AHT sensor!"));
//return;
}
delay(100);
//sensorPowerOff();
Serial.print(F("Moisture ADC : "));
Serial.println(sensorValue);
//Serial.print(F("Humidity: "));
//Serial.print(humidity);
//Serial.print(F("% Temperature: "));
//Serial.print(temperature);
//Serial.println("Humidity is " + (String)humidity);
//Serial.println("Temperature is " + (String)temperature);
String message = "#"+(String)packetnum+" Humidity:"+(String)humidity+"% Temperature:"+(String)temperature+"C"+" ADC:"+(String)sensorValue;
Serial.println(message);
packetnum++;
Serial.println("Transmit: Sending to rf95_server");
// Send a message to rf95_server
uint8_t radioPacket[message.length()+1];
message.toCharArray(radioPacket, message.length()+1);
radioPacket[message.length()+1]= '\0';
The last USER CODE portion (Init section) is:
//digitalWrite(sensorPowerCtrlPin, LOW);//Sensor power on
sensorPowerOn();
Wire.begin(); //Join I2C bus
//Check if the AHT10 will acknowledge
if (humiditySensor.begin() == false)
{
Serial.println("AHT10 not detected. Please check wiring. Freezing.");
//while (1);
}
else
Serial.println("AHT10 acknowledged.");
Platformio seems not have a loop section where I could put the respective code and LMIC seems to arrange the data for sending different than Radiohead.
So my data I am looking for is in the variables
You’ve correctly identified that your device isn’t getting the Join Accept so no EV_JOINED.
How far apart is the device & gateway - too close & it can overload the input circuitry which scrambles the message - ideally 3 to 5m and a brick wall between them.
Be aware thay CircuitPython for LoRaWAN uses the TinyLora library under the hood.
TinyLora is not LoRaWAN compliant and cannot handle downlinks and MAC commands and shall therefore not be used with TTN V3.
Only the MCCI LMIC library generates those events. Classic LMIC does not. LMIC-node uses Classic LMIC for 8-bit AVR MCU (see README.md). This explains why you do not see these events.
If the join fails, check if DIO1 is properly connected (see the board’s BSF for details).
Do you have tried to get it working with ABP already? Latter does not depend on DIO1 (only on DIO0).
About the RPI Pico - my plan is to change to Platformio like the Atmega 328p as I would like to use the deep sleep functionality.
About the Atmega328p - I tried ABP before with the LMIC-Node but compiling failed with an error message:
src/LMIC-node.h:110:6: error: #error Do NOT use ABP activation when using the deprecated IBM LMIC framework library. On The Things Network V3 this will cause a downlink message for EVERY uplink message because it does properly handle MAC commands.
Ah, typo in the error message: “it does properly handle MAC commands” should read “it does NOT properly handle MAC commands” instead.
LMIC-node for 8-bit AVR MCU’s, due to their limited memory, does not support MCCI LMIC, only Classic LMIC (IBM LMIC Framework).
Unfortunately latter has its shortcomings, it is no longer maintained and is now deprecated. It should not be used with ABP for TTN V3.
So sorry, for 8-bit AVR MCU, LMIC-node cannot be used for ABP (was not a good suggestion for your AVR board).
It’s a hardware thing. I remember with ATmega328 and RFM95 were 5µA possible with external Interrupt 1µA. How low can a ATmega4808 with RFM95 go? I see you have a nice test build on your workbench.