
if
(p_start && (
1
==
sscanf
(p_start,
"SNR %d"
, &snr)))
{
u8x8.setCursor(
0
,
7
);
u8x8.print(
" "
);
u8x8.setCursor(
2
,
7
);
u8x8.print(
"snr :"
);
u8x8.print(snr);
}
}
void
setup
(
void
)
{
u8x8.begin();
u8x8.setFlipMode(
1
);
u8x8.setFont(u8x8_font_chroma48medium8_r);
Serial.begin(
115200
);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
Serial1.begin(
9600
);
Serial.print(
"E5 LORAWAN TEST\r\n"
);
u8x8.setCursor(
0
,
0
);
if
(at_send_check_response(
"+AT: OK"
,
100
,
"AT\r\n"
))
{
is_exist =
true
;
at_send_check_response(
"+ID: AppEui"
,
1000
,
"AT+ID\r\n"
);
at_send_check_response(
"+MODE: LWOTAA"
,
1000
,
"AT+MODE=LWOTAA\r\n"
);
at_send_check_response(
"+DR: EU868"
,
1000
,
"AT+DR=EU868\r\n"
);
at_send_check_response(
"+CH: NUM"
,
1000
,
"AT+CH=NUM,0-2\r\n"
);
at_send_check_response(
"+KEY: APPKEY"
,
1000
,
"AT+KEY=APPKEY,\"2B7E151628AED2A6ABF7158809CF4F3C\"\r\n"
);
at_send_check_response(
"+CLASS: C"
,
1000
,
"AT+CLASS=A\r\n"
);
at_send_check_response(
"+PORT: 8"
,
1000
,
"AT+PORT=8\r\n"
);
delay(
200
);
u8x8.setCursor(
5
,
0
);
u8x8.print(
"LoRaWAN"
);
is_join =
true
;
}
else
{
is_exist =
false
;
Serial.print(
"No E5 module found.\r\n"
);
u8x8.setCursor(
0
,
1
);
u8x8.print(
"unfound E5 !"
);
}
dht.begin();
u8x8.setCursor(
0
,
2
);
u8x8.setCursor(
2
,
2
);