Skip to content

Commit

Permalink
test with uno.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nat committed May 10, 2018
1 parent 7e6d3c6 commit 9e74d50
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 210 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ void setup()
{
Serial.begin(57600);
Serial2.begin(9600);

Serial.println("Chiang Mai Maker Club's AT-Bridge engine is started.");
Bridge.init(&Serial, &Serial2);

}

void loop()
Expand Down
21 changes: 21 additions & 0 deletions examples/AT-bridge_uno/AT-bridge_uno.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#include <Arduino.h>
#include <CMMC_NB_IoT.h>
#include <AltSoftSerial.h>

CMMC_NB_IoT nb;
CMMC_AT_Bridge &Bridge = nb.Bridge;
AltSoftSerial altsoftSerial;

void setup()
{
Serial.begin(57600);
altsoftSerial.begin(9600);

Serial.println("Chiang Mai Maker Club's AT-Bridge engine is started.");
Bridge.init(&Serial, &altsoftSerial);
}

void loop()
{
Bridge.loop();
}
55 changes: 0 additions & 55 deletions examples/altsoftserial_example/altsoftserial_example.ino

This file was deleted.

16 changes: 0 additions & 16 deletions examples/hwserial_example/hwserial_example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,6 @@ void setup()

nb.onConnected([]() {
Serial.println("[user] NB-IoT Network connected");
char tmp[400];
nb._writeCommand(F("AT+CSQ"), 10L, tmp); // imsi sim
String t = String(tmp);
t.replace("OK", " - OK");
Serial.println(t);
int ct = 1;
int sockId = nb.createUdpSocket("159.89.205.216", 11221, UDPConfig::DISABLE_RECV);
nb.createUdpSocket("159.89.205.216", 11222, UDPConfig::DISABLE_RECV);
String _tmp = "";
// while(1) {
// _tmp += String(ct) + "-";
// Serial.println(String("payload size = ") + _tmp.length()) + String("byte");
// nb.sendMessage(_tmp);
// delay(2000);
// ct++;
// }
});

nb.begin();
Expand Down
127 changes: 0 additions & 127 deletions examples/softserial_example/softserial_example.ino

This file was deleted.

22 changes: 11 additions & 11 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

; [env:CMMC_NB_IoT_app_uno]
; board = uno
; platform = atmelavr
; framework = arduino
; lib_deps =
; AltSoftSerial
; extra_scripts = extra_script.py

[env:CMMC_NB_IoT_app_mega]
board = megaatmega2560
[env:CMMC_NB_IoT_app_uno]
board = uno
platform = atmelavr
framework = arduino
lib_deps =
AltSoftSerial
extra_scripts = extra_script.py

; [env:CMMC_NB_IoT_app_mega]
; board = megaatmega2560
; platform = atmelavr
; framework = arduino
; lib_deps =
; AltSoftSerial
; extra_scripts = extra_script.py


[platformio]
; src_dir = examples/altsoftserial_example
; src_dir = examples/softserial_example
# src_dir = examples/softserial_example
; src_dir = examples/hwserial_example
src_dir = examples/AT-bridge_serial2
src_dir = examples/AT-bridge_uno
lib_dir = .src-dev

0 comments on commit 9e74d50

Please sign in to comment.