From 1348122d8d03bbb9b5d32f165ff942bb679bc0a1 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Feb 2018 13:15:55 +0200 Subject: [PATCH 1/9] Format board manifests --- boards/adafruit_circuitplayground_m0.json | 2 +- boards/adafruit_feather_m0.json | 6 +++--- boards/adafruit_feather_m0_express.json | 6 +++--- boards/adafruit_gemma_m0.json | 6 +++--- boards/adafruit_metro_m0.json | 6 +++--- boards/adafruit_trinket_m0.json | 6 +++--- boards/due.json | 6 +++--- boards/mkrzero.json | 2 +- boards/sainSmartDueUSB.json | 2 +- boards/sodaq_autonomo.json | 4 ++-- boards/sodaq_explorer.json | 4 ++-- boards/sodaq_one.json | 4 ++-- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/boards/adafruit_circuitplayground_m0.json b/boards/adafruit_circuitplayground_m0.json index db734fd..586d563 100644 --- a/boards/adafruit_circuitplayground_m0.json +++ b/boards/adafruit_circuitplayground_m0.json @@ -44,4 +44,4 @@ }, "url": "https://www.adafruit.com/product/3333", "vendor": "Adafruit" -} +} \ No newline at end of file diff --git a/boards/adafruit_feather_m0.json b/boards/adafruit_feather_m0.json index 0c7835a..bf9d96f 100644 --- a/boards/adafruit_feather_m0.json +++ b/boards/adafruit_feather_m0.json @@ -1,9 +1,8 @@ { "build": { "core": "adafruit", - "system": "samd", - "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DARDUINO_SAMD_FEATHER_M0 -D__SAMD21G18A__", "cpu": "cortex-m0plus", + "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DARDUINO_SAMD_FEATHER_M0 -D__SAMD21G18A__", "f_cpu": "48000000L", "hwids": [ [ @@ -17,6 +16,7 @@ ], "ldscript": "flash_with_bootloader.ld", "mcu": "samd21g18a", + "system": "samd", "usb_product": "Adafruit Feather M0", "variant": "feather_m0" }, @@ -45,4 +45,4 @@ }, "url": "https://www.adafruit.com/product/2772", "vendor": "Adafruit" -} +} \ No newline at end of file diff --git a/boards/adafruit_feather_m0_express.json b/boards/adafruit_feather_m0_express.json index 1cbbcd9..ba25f58 100644 --- a/boards/adafruit_feather_m0_express.json +++ b/boards/adafruit_feather_m0_express.json @@ -1,9 +1,8 @@ { "build": { "core": "adafruit", - "system": "samd", - "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DARDUINO_SAMD_FEATHER_M0 -DARDUINO_SAMD_FEATHER_M0_EXPRESS -D__SAMD21G18A__", "cpu": "cortex-m0plus", + "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DARDUINO_SAMD_FEATHER_M0 -DARDUINO_SAMD_FEATHER_M0_EXPRESS -D__SAMD21G18A__", "f_cpu": "48000000L", "hwids": [ [ @@ -17,6 +16,7 @@ ], "ldscript": "flash_with_bootloader.ld", "mcu": "samd21g18a", + "system": "samd", "usb_product": "Feather M0 Express", "variant": "feather_m0_express" }, @@ -45,4 +45,4 @@ }, "url": "https://www.adafruit.com/product/3403", "vendor": "Adafruit" -} +} \ No newline at end of file diff --git a/boards/adafruit_gemma_m0.json b/boards/adafruit_gemma_m0.json index 335c276..a745e21 100644 --- a/boards/adafruit_gemma_m0.json +++ b/boards/adafruit_gemma_m0.json @@ -1,9 +1,8 @@ { "build": { "core": "adafruit", - "system": "samd", - "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_GEMMA_M0 -DCRYSTALLESS -DADAFRUIT_GEMMA_M0 -D__SAMD21E18A__", "cpu": "cortex-m0plus", + "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_GEMMA_M0 -DCRYSTALLESS -DADAFRUIT_GEMMA_M0 -D__SAMD21E18A__", "f_cpu": "48000000L", "hwids": [ [ @@ -17,6 +16,7 @@ ], "ldscript": "flash_with_bootloader.ld", "mcu": "samd21e18a", + "system": "samd", "usb_product": "Adafruit Gemma M0", "variant": "gemma_m0" }, @@ -45,4 +45,4 @@ }, "url": "https://www.adafruit.com/product/3501", "vendor": "Adafruit" -} +} \ No newline at end of file diff --git a/boards/adafruit_metro_m0.json b/boards/adafruit_metro_m0.json index a557213..7e15f27 100644 --- a/boards/adafruit_metro_m0.json +++ b/boards/adafruit_metro_m0.json @@ -1,9 +1,8 @@ { "build": { "core": "adafruit", - "system": "samd", - "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DDADAFRUIT_METRO_M0_EXPRESS -D__SAMD21G18A__", "cpu": "cortex-m0plus", + "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_SAMD_ZERO -DDADAFRUIT_METRO_M0_EXPRESS -D__SAMD21G18A__", "f_cpu": "48000000L", "hwids": [ [ @@ -17,6 +16,7 @@ ], "ldscript": "flash_with_bootloader.ld", "mcu": "samd21g18a", + "system": "samd", "usb_product": "Metro M0 Expres", "variant": "metro_m0" }, @@ -45,4 +45,4 @@ }, "url": "https://www.adafruit.com/product/3505", "vendor": "Adafruit" -} +} \ No newline at end of file diff --git a/boards/adafruit_trinket_m0.json b/boards/adafruit_trinket_m0.json index e6ace5e..9df7e5e 100644 --- a/boards/adafruit_trinket_m0.json +++ b/boards/adafruit_trinket_m0.json @@ -1,9 +1,8 @@ { "build": { "core": "adafruit", - "system": "samd", - "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_TRINKET_M0 -DCRYSTALLESS -DADAFRUIT_TRINKET_M0 -D__SAMD21E18A__", "cpu": "cortex-m0plus", + "extra_flags": "-DARDUINO_ARCH_SAMD -DARDUINO_TRINKET_M0 -DCRYSTALLESS -DADAFRUIT_TRINKET_M0 -D__SAMD21E18A__", "f_cpu": "48000000L", "hwids": [ [ @@ -17,6 +16,7 @@ ], "ldscript": "flash_with_bootloader.ld", "mcu": "samd21e18a", + "system": "samd", "usb_product": "Adafruit Trinket M0", "variant": "trinket_m0" }, @@ -45,4 +45,4 @@ }, "url": "https://www.adafruit.com/product/3500", "vendor": "Adafruit" -} +} \ No newline at end of file diff --git a/boards/due.json b/boards/due.json index 4295520..ff0babf 100644 --- a/boards/due.json +++ b/boards/due.json @@ -23,12 +23,12 @@ "usb_product": "Arduino Due", "variant": "arduino_due_x" }, - "debug": { - "openocd_chipname": "at91sam3X8E" - }, "connectivity": [ "can" ], + "debug": { + "openocd_chipname": "at91sam3X8E" + }, "frameworks": [ "arduino", "simba" diff --git a/boards/mkrzero.json b/boards/mkrzero.json index 3ec7e57..04c6fbe 100644 --- a/boards/mkrzero.json +++ b/boards/mkrzero.json @@ -44,4 +44,4 @@ }, "url": "https://www.arduino.cc/en/Main/ArduinoBoardMKRZero", "vendor": "Arduino" -} +} \ No newline at end of file diff --git a/boards/sainSmartDueUSB.json b/boards/sainSmartDueUSB.json index 19f238a..ee9950e 100644 --- a/boards/sainSmartDueUSB.json +++ b/boards/sainSmartDueUSB.json @@ -29,13 +29,13 @@ "disable_flushing": true, "maximum_ram_size": 32768, "maximum_size": 524288, + "native_usb": true, "protocol": "sam-ba", "protocols": [ "sam-ba", "jlink", "blackmagic" ], - "native_usb": true, "require_upload_port": true, "use_1200bps_touch": true, "wait_for_upload_port": true diff --git a/boards/sodaq_autonomo.json b/boards/sodaq_autonomo.json index cf4e11a..92c4538 100644 --- a/boards/sodaq_autonomo.json +++ b/boards/sodaq_autonomo.json @@ -1,7 +1,6 @@ { "build": { "core": "sodaq", - "system": "samd", "cpu": "cortex-m0plus", "extra_flags": "-D__SAMD21J18A__ -DARDUINO_ARCH_SAMD -DARDUINO_SODAQ_AUTONOMO", "f_cpu": "48000000L", @@ -17,6 +16,7 @@ ], "ldscript": "flash_with_bootloader.ld", "mcu": "samd21j18a", + "system": "samd", "usb_product": "SODAQ Autonomo", "variant": "sodaq_autonomo" }, @@ -45,4 +45,4 @@ }, "url": "http://support.sodaq.com/sodaq-one/autonomo/getting-started-autonomo/", "vendor": "SODAQ" -} +} \ No newline at end of file diff --git a/boards/sodaq_explorer.json b/boards/sodaq_explorer.json index 32b9ec5..1d53890 100644 --- a/boards/sodaq_explorer.json +++ b/boards/sodaq_explorer.json @@ -1,7 +1,6 @@ { "build": { "core": "sodaq", - "system": "samd", "cpu": "cortex-m0plus", "extra_flags": "-D__SAMD21J18A__ -DARDUINO_ARCH_SAMD -DARDUINO_SODAQ_EXPLORER", "f_cpu": "48000000L", @@ -17,6 +16,7 @@ ], "ldscript": "flash_with_bootloader.ld", "mcu": "samd21j18a", + "system": "samd", "usb_product": "SODAQ ExpLoRer", "variant": "sodaq_explorer" }, @@ -45,4 +45,4 @@ }, "url": "http://support.sodaq.com/sodaq-one/explorer/", "vendor": "SODAQ" -} +} \ No newline at end of file diff --git a/boards/sodaq_one.json b/boards/sodaq_one.json index 42a3270..85ea49f 100644 --- a/boards/sodaq_one.json +++ b/boards/sodaq_one.json @@ -1,7 +1,6 @@ { "build": { "core": "sodaq", - "system": "samd", "cpu": "cortex-m0plus", "extra_flags": "-D__SAMD21G18A__ -DARDUINO_ARCH_SAMD -DARDUINO_SODAQ_ONE", "f_cpu": "48000000L", @@ -17,6 +16,7 @@ ], "ldscript": "flash_with_bootloader.ld", "mcu": "samd21g18a", + "system": "samd", "usb_product": "SODAQ ONE", "variant": "sodaq_one" }, @@ -45,4 +45,4 @@ }, "url": "http://support.sodaq.com/sodaq-one/", "vendor": "SODAQ" -} +} \ No newline at end of file From 4e2525498ce61ea3b9428070c6db59b5f68c16cc Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Feb 2018 13:17:56 +0200 Subject: [PATCH 2/9] Format board manifests --- boards/adafruit_circuitplayground_m0.json | 2 +- boards/adafruit_feather_m0.json | 2 +- boards/adafruit_feather_m0_express.json | 2 +- boards/adafruit_gemma_m0.json | 2 +- boards/adafruit_metro_m0.json | 2 +- boards/adafruit_trinket_m0.json | 2 +- boards/digix.json | 2 +- boards/due.json | 2 +- boards/dueUSB.json | 2 +- boards/macchina2.json | 2 +- boards/mkr1000USB.json | 2 +- boards/mkrfox1200.json | 2 +- boards/mkrgsm1400.json | 2 +- boards/mkrwan1300.json | 2 +- boards/mkrzero.json | 2 +- boards/mzeroUSB.json | 2 +- boards/mzeropro.json | 2 +- boards/mzeroproUSB.json | 2 +- boards/sainSmartDue.json | 2 +- boards/sainSmartDueUSB.json | 2 +- boards/samd21_xpro.json | 2 +- boards/samd21g18a.json | 2 +- boards/saml21_xpro_b.json | 2 +- boards/samr21_xpro.json | 2 +- boards/sodaq_autonomo.json | 2 +- boards/sodaq_explorer.json | 2 +- boards/sodaq_one.json | 2 +- boards/sparkfun_samd21_dev_usb.json | 2 +- boards/sparkfun_samd21_mini_usb.json | 2 +- boards/tian.json | 2 +- boards/zero.json | 2 +- boards/zeroUSB.json | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/boards/adafruit_circuitplayground_m0.json b/boards/adafruit_circuitplayground_m0.json index 586d563..db734fd 100644 --- a/boards/adafruit_circuitplayground_m0.json +++ b/boards/adafruit_circuitplayground_m0.json @@ -44,4 +44,4 @@ }, "url": "https://www.adafruit.com/product/3333", "vendor": "Adafruit" -} \ No newline at end of file +} diff --git a/boards/adafruit_feather_m0.json b/boards/adafruit_feather_m0.json index bf9d96f..4c50f8c 100644 --- a/boards/adafruit_feather_m0.json +++ b/boards/adafruit_feather_m0.json @@ -45,4 +45,4 @@ }, "url": "https://www.adafruit.com/product/2772", "vendor": "Adafruit" -} \ No newline at end of file +} diff --git a/boards/adafruit_feather_m0_express.json b/boards/adafruit_feather_m0_express.json index ba25f58..e25e6a6 100644 --- a/boards/adafruit_feather_m0_express.json +++ b/boards/adafruit_feather_m0_express.json @@ -45,4 +45,4 @@ }, "url": "https://www.adafruit.com/product/3403", "vendor": "Adafruit" -} \ No newline at end of file +} diff --git a/boards/adafruit_gemma_m0.json b/boards/adafruit_gemma_m0.json index a745e21..448c525 100644 --- a/boards/adafruit_gemma_m0.json +++ b/boards/adafruit_gemma_m0.json @@ -45,4 +45,4 @@ }, "url": "https://www.adafruit.com/product/3501", "vendor": "Adafruit" -} \ No newline at end of file +} diff --git a/boards/adafruit_metro_m0.json b/boards/adafruit_metro_m0.json index 7e15f27..f6f1fc7 100644 --- a/boards/adafruit_metro_m0.json +++ b/boards/adafruit_metro_m0.json @@ -45,4 +45,4 @@ }, "url": "https://www.adafruit.com/product/3505", "vendor": "Adafruit" -} \ No newline at end of file +} diff --git a/boards/adafruit_trinket_m0.json b/boards/adafruit_trinket_m0.json index 9df7e5e..7d7f2de 100644 --- a/boards/adafruit_trinket_m0.json +++ b/boards/adafruit_trinket_m0.json @@ -45,4 +45,4 @@ }, "url": "https://www.adafruit.com/product/3500", "vendor": "Adafruit" -} \ No newline at end of file +} diff --git a/boards/digix.json b/boards/digix.json index ad78788..6bbb532 100644 --- a/boards/digix.json +++ b/boards/digix.json @@ -42,4 +42,4 @@ }, "url": "http://digistump.com/products/50", "vendor": "Digistump" -} \ No newline at end of file +} diff --git a/boards/due.json b/boards/due.json index ff0babf..503365a 100644 --- a/boards/due.json +++ b/boards/due.json @@ -51,4 +51,4 @@ }, "url": "https://www.arduino.cc/en/Main/ArduinoBoardDue", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/dueUSB.json b/boards/dueUSB.json index 71a6028..0c7d138 100644 --- a/boards/dueUSB.json +++ b/boards/dueUSB.json @@ -47,4 +47,4 @@ }, "url": "https://www.arduino.cc/en/Main/ArduinoBoardDue", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/macchina2.json b/boards/macchina2.json index f007a38..75c3ea7 100644 --- a/boards/macchina2.json +++ b/boards/macchina2.json @@ -46,4 +46,4 @@ }, "url": "https://www.macchina.cc", "vendor": "Macchina" -} \ No newline at end of file +} diff --git a/boards/mkr1000USB.json b/boards/mkr1000USB.json index 06070a6..68a5e37 100644 --- a/boards/mkr1000USB.json +++ b/boards/mkr1000USB.json @@ -55,4 +55,4 @@ }, "url": "https://www.arduino.cc/en/Main/ArduinoMKR1000", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/mkrfox1200.json b/boards/mkrfox1200.json index d8001c0..5727e73 100644 --- a/boards/mkrfox1200.json +++ b/boards/mkrfox1200.json @@ -44,4 +44,4 @@ }, "url": "https://www.arduino.cc/en/Main.ArduinoBoardMKRFox1200", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/mkrgsm1400.json b/boards/mkrgsm1400.json index a8b7d0d..43a7fef 100644 --- a/boards/mkrgsm1400.json +++ b/boards/mkrgsm1400.json @@ -44,4 +44,4 @@ }, "url": "https://store.arduino.cc/mkr-gsm-1400", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/mkrwan1300.json b/boards/mkrwan1300.json index ffa3064..eba0369 100644 --- a/boards/mkrwan1300.json +++ b/boards/mkrwan1300.json @@ -44,4 +44,4 @@ }, "url": "https://store.arduino.cc/mkr-wan-1300", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/mkrzero.json b/boards/mkrzero.json index 04c6fbe..3ec7e57 100644 --- a/boards/mkrzero.json +++ b/boards/mkrzero.json @@ -44,4 +44,4 @@ }, "url": "https://www.arduino.cc/en/Main/ArduinoBoardMKRZero", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/mzeroUSB.json b/boards/mzeroUSB.json index 37c1298..ffa22a2 100644 --- a/boards/mzeroUSB.json +++ b/boards/mzeroUSB.json @@ -44,4 +44,4 @@ }, "url": "https://www.arduino.cc/en/Main/ArduinoBoardM0", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/mzeropro.json b/boards/mzeropro.json index aed5cb6..4335fb2 100644 --- a/boards/mzeropro.json +++ b/boards/mzeropro.json @@ -47,4 +47,4 @@ }, "url": "https://www.arduino.cc/en/Main/ArduinoBoardM0PRO", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/mzeroproUSB.json b/boards/mzeroproUSB.json index d141d62..33374e0 100644 --- a/boards/mzeroproUSB.json +++ b/boards/mzeroproUSB.json @@ -55,4 +55,4 @@ }, "url": "https://www.arduino.cc/en/Main/ArduinoBoardM0PRO", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/sainSmartDue.json b/boards/sainSmartDue.json index 13145f7..2d8c95c 100644 --- a/boards/sainSmartDue.json +++ b/boards/sainSmartDue.json @@ -42,4 +42,4 @@ }, "url": "http://www.sainsmart.com/arduino/control-boards/sainsmart-due-atmel-sam3x8e-arm-cortex-m3-board-black.html", "vendor": "SainSmart" -} \ No newline at end of file +} diff --git a/boards/sainSmartDueUSB.json b/boards/sainSmartDueUSB.json index ee9950e..dc46327 100644 --- a/boards/sainSmartDueUSB.json +++ b/boards/sainSmartDueUSB.json @@ -42,4 +42,4 @@ }, "url": "http://www.sainsmart.com/arduino/control-boards/sainsmart-due-atmel-sam3x8e-arm-cortex-m3-board-black.html", "vendor": "SainSmart" -} \ No newline at end of file +} diff --git a/boards/samd21_xpro.json b/boards/samd21_xpro.json index eef5d50..120c2b7 100644 --- a/boards/samd21_xpro.json +++ b/boards/samd21_xpro.json @@ -27,4 +27,4 @@ }, "url": "https://developer.mbed.org/platforms/SAMD21-XPRO/", "vendor": "Atmel" -} \ No newline at end of file +} diff --git a/boards/samd21g18a.json b/boards/samd21g18a.json index 6662366..5cff985 100644 --- a/boards/samd21g18a.json +++ b/boards/samd21g18a.json @@ -27,4 +27,4 @@ }, "url": "https://developer.mbed.org/platforms/SAMW25-XPRO/", "vendor": "Atmel" -} \ No newline at end of file +} diff --git a/boards/saml21_xpro_b.json b/boards/saml21_xpro_b.json index bb44156..8147ea9 100644 --- a/boards/saml21_xpro_b.json +++ b/boards/saml21_xpro_b.json @@ -27,4 +27,4 @@ }, "url": "https://developer.mbed.org/platforms/SAML21-XPRO/", "vendor": "Atmel" -} \ No newline at end of file +} diff --git a/boards/samr21_xpro.json b/boards/samr21_xpro.json index 3a459ec..527666c 100644 --- a/boards/samr21_xpro.json +++ b/boards/samr21_xpro.json @@ -27,4 +27,4 @@ }, "url": "https://developer.mbed.org/platforms/SAMR21-XPRO/", "vendor": "Atmel" -} \ No newline at end of file +} diff --git a/boards/sodaq_autonomo.json b/boards/sodaq_autonomo.json index 92c4538..ff11ae8 100644 --- a/boards/sodaq_autonomo.json +++ b/boards/sodaq_autonomo.json @@ -45,4 +45,4 @@ }, "url": "http://support.sodaq.com/sodaq-one/autonomo/getting-started-autonomo/", "vendor": "SODAQ" -} \ No newline at end of file +} diff --git a/boards/sodaq_explorer.json b/boards/sodaq_explorer.json index 1d53890..80ed5ac 100644 --- a/boards/sodaq_explorer.json +++ b/boards/sodaq_explorer.json @@ -45,4 +45,4 @@ }, "url": "http://support.sodaq.com/sodaq-one/explorer/", "vendor": "SODAQ" -} \ No newline at end of file +} diff --git a/boards/sodaq_one.json b/boards/sodaq_one.json index 85ea49f..9d29374 100644 --- a/boards/sodaq_one.json +++ b/boards/sodaq_one.json @@ -45,4 +45,4 @@ }, "url": "http://support.sodaq.com/sodaq-one/", "vendor": "SODAQ" -} \ No newline at end of file +} diff --git a/boards/sparkfun_samd21_dev_usb.json b/boards/sparkfun_samd21_dev_usb.json index 54b0e1d..854e4df 100644 --- a/boards/sparkfun_samd21_dev_usb.json +++ b/boards/sparkfun_samd21_dev_usb.json @@ -44,4 +44,4 @@ }, "url": "https://www.sparkfun.com/products/13672", "vendor": "SparkFun" -} \ No newline at end of file +} diff --git a/boards/sparkfun_samd21_mini_usb.json b/boards/sparkfun_samd21_mini_usb.json index 5d0f67b..d9ed6c6 100644 --- a/boards/sparkfun_samd21_mini_usb.json +++ b/boards/sparkfun_samd21_mini_usb.json @@ -44,4 +44,4 @@ }, "url": "https://www.sparkfun.com/products/13664", "vendor": "SparkFun" -} \ No newline at end of file +} diff --git a/boards/tian.json b/boards/tian.json index a68d269..82094ca 100644 --- a/boards/tian.json +++ b/boards/tian.json @@ -47,4 +47,4 @@ }, "url": "https://www.arduino.cc/en/Main/ArduinoBoardTian", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/zero.json b/boards/zero.json index e9e5733..9dc3e9d 100644 --- a/boards/zero.json +++ b/boards/zero.json @@ -47,4 +47,4 @@ }, "url": "https://www.arduino.cc/en/Main/ArduinoBoardZero", "vendor": "Arduino" -} \ No newline at end of file +} diff --git a/boards/zeroUSB.json b/boards/zeroUSB.json index 78db719..e1ca78f 100644 --- a/boards/zeroUSB.json +++ b/boards/zeroUSB.json @@ -51,4 +51,4 @@ }, "url": "https://www.arduino.cc/en/Main/ArduinoBoardZero", "vendor": "Arduino" -} \ No newline at end of file +} From b728e493c96124de365ac0c9475f5545c3572212 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 13 Mar 2018 17:28:05 +0200 Subject: [PATCH 3/9] Update Arduino Core to 1.6.18 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index b1da945..0078ffd 100644 --- a/platform.json +++ b/platform.json @@ -40,7 +40,7 @@ "framework-arduinosam": { "type": "framework", "optional": true, - "version": "~2.10617.0" + "version": "~2.10618.0" }, "framework-mbed": { "type": "framework", From 4fbc631ec6a66ae1207a4b4b9e9aeae950da6716 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 13 Mar 2018 17:29:32 +0200 Subject: [PATCH 4/9] Add support for Arduino framework for Atmel ATSAMW25-XPRO board --- boards/samd21g18a.json | 17 ++- examples/arduino-wifi-scan/.gitignore | 5 + examples/arduino-wifi-scan/.travis.yml | 67 ++++++++++++ examples/arduino-wifi-scan/README.rst | 32 ++++++ examples/arduino-wifi-scan/lib/readme.txt | 36 +++++++ examples/arduino-wifi-scan/platformio.ini | 17 +++ examples/arduino-wifi-scan/src/main.cpp | 122 ++++++++++++++++++++++ 7 files changed, 295 insertions(+), 1 deletion(-) create mode 100644 examples/arduino-wifi-scan/.gitignore create mode 100644 examples/arduino-wifi-scan/.travis.yml create mode 100644 examples/arduino-wifi-scan/README.rst create mode 100644 examples/arduino-wifi-scan/lib/readme.txt create mode 100644 examples/arduino-wifi-scan/platformio.ini create mode 100644 examples/arduino-wifi-scan/src/main.cpp diff --git a/boards/samd21g18a.json b/boards/samd21g18a.json index 5cff985..4a50423 100644 --- a/boards/samd21g18a.json +++ b/boards/samd21g18a.json @@ -1,9 +1,23 @@ { "build": { + "core": "samd", "cpu": "cortex-m0plus", + "extra_flags": "-DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -D__SAMD21G18A__", + "hwids": [ + [ + "0x03EB", + "0x2111" + ] + ], + "ldscript": "flash_without_bootloader.ld", "f_cpu": "48000000L", - "mcu": "atsamd21g18a" + "mcu": "atsamd21g18a", + "usb_product": "Atmel ATSAMW25-XPRO", + "variant": "w25_xplained_pro" }, + "connectivity": [ + "wifi" + ], "debug": { "onboard_tools": [ "cmsis-dap" @@ -11,6 +25,7 @@ "openocd_chipname": "at91samd21g18" }, "frameworks": [ + "arduino", "mbed" ], "name": "Atmel ATSAMW25-XPRO", diff --git a/examples/arduino-wifi-scan/.gitignore b/examples/arduino-wifi-scan/.gitignore new file mode 100644 index 0000000..6a01030 --- /dev/null +++ b/examples/arduino-wifi-scan/.gitignore @@ -0,0 +1,5 @@ +.pioenvs +.piolibdeps +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json diff --git a/examples/arduino-wifi-scan/.travis.yml b/examples/arduino-wifi-scan/.travis.yml new file mode 100644 index 0000000..9443843 --- /dev/null +++ b/examples/arduino-wifi-scan/.travis.yml @@ -0,0 +1,67 @@ +# Continuous Integration (CI) is the practice, in software +# engineering, of merging all developer working copies with a shared mainline +# several times a day < http://docs.platformio.org/page/ci/index.html > +# +# Documentation: +# +# * Travis CI Embedded Builds with PlatformIO +# < https://docs.travis-ci.com/user/integration/platformio/ > +# +# * PlatformIO integration with Travis CI +# < http://docs.platformio.org/page/ci/travis.html > +# +# * User Guide for `platformio ci` command +# < http://docs.platformio.org/page/userguide/cmd_ci.html > +# +# +# Please choice one of the following templates (proposed below) and uncomment +# it (remove "# " before each line) or use own configuration according to the +# Travis CI documentation (see above). +# + + +# +# Template #1: General project. Test it using existing `platformio.ini`. +# + +# language: python +# python: +# - "2.7" +# +# sudo: false +# cache: +# directories: +# - "~/.platformio" +# +# install: +# - pip install -U platformio +# - platformio update +# +# script: +# - platformio run + + +# +# Template #2: The project is intended to by used as a library with examples +# + +# language: python +# python: +# - "2.7" +# +# sudo: false +# cache: +# directories: +# - "~/.platformio" +# +# env: +# - PLATFORMIO_CI_SRC=path/to/test/file.c +# - PLATFORMIO_CI_SRC=examples/file.ino +# - PLATFORMIO_CI_SRC=path/to/test/directory +# +# install: +# - pip install -U platformio +# - platformio update +# +# script: +# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N diff --git a/examples/arduino-wifi-scan/README.rst b/examples/arduino-wifi-scan/README.rst new file mode 100644 index 0000000..2a723d2 --- /dev/null +++ b/examples/arduino-wifi-scan/README.rst @@ -0,0 +1,32 @@ +.. Copyright 2014-present PlatformIO + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +How to build PlatformIO based project +===================================== + +1. `Install PlatformIO Core `_ +2. Download `development platform with examples `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platform-atmelsam/examples/arduino-wifi-scan + + # Build project + > platformio run + + # Upload firmware + > platformio run --target upload + + # Clean build files + > platformio run --target clean diff --git a/examples/arduino-wifi-scan/lib/readme.txt b/examples/arduino-wifi-scan/lib/readme.txt new file mode 100644 index 0000000..dbadc3d --- /dev/null +++ b/examples/arduino-wifi-scan/lib/readme.txt @@ -0,0 +1,36 @@ + +This directory is intended for the project specific (private) libraries. +PlatformIO will compile them to static libraries and link to executable file. + +The source code of each library should be placed in separate directory, like +"lib/private_lib/[here are source files]". + +For example, see how can be organized `Foo` and `Bar` libraries: + +|--lib +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| |--Foo +| | |- Foo.c +| | |- Foo.h +| |- readme.txt --> THIS FILE +|- platformio.ini +|--src + |- main.c + +Then in `src/main.c` you should use: + +#include +#include + +// rest H/C/CPP code + +PlatformIO will find your libraries automatically, configure preprocessor's +include paths and build them. + +More information about PlatformIO Library Dependency Finder +- http://docs.platformio.org/page/librarymanager/ldf.html diff --git a/examples/arduino-wifi-scan/platformio.ini b/examples/arduino-wifi-scan/platformio.ini new file mode 100644 index 0000000..a69939b --- /dev/null +++ b/examples/arduino-wifi-scan/platformio.ini @@ -0,0 +1,17 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; http://docs.platformio.org/page/projectconf.html + +[env:samd21g18a] +platform = atmelsam +board = samd21g18a +framework = arduino +lib_deps = + ; https://platformio.org/lib/show/299/WiFi101 + WiFi101 diff --git a/examples/arduino-wifi-scan/src/main.cpp b/examples/arduino-wifi-scan/src/main.cpp new file mode 100644 index 0000000..060e1e4 --- /dev/null +++ b/examples/arduino-wifi-scan/src/main.cpp @@ -0,0 +1,122 @@ +/* + + This example prints the WiFi shield's MAC address, and + scans for available WiFi networks using the WiFi shield. + Every ten seconds, it scans again. It doesn't actually + connect to any network, so no encryption scheme is specified. + + Circuit: + * WiFi shield attached + + created 13 July 2010 + by dlf (Metodo2 srl) + modified 21 Junn 2012 + by Tom Igoe and Jaymes Dec + */ + + +#include +#include + + +void printMacAddress(); +void listNetworks(); +void printEncryptionType(int thisType); + +void setup() { + //Initialize serial and wait for port to open: + Serial.begin(9600); + while (!Serial) { + ; // wait for serial port to connect. Needed for native USB port only + } + + // check for the presence of the shield: + if (WiFi.status() == WL_NO_SHIELD) { + Serial.println("WiFi shield not present"); + // don't continue: + while (true); + } + + // Print WiFi MAC address: + printMacAddress(); + + // scan for existing networks: + Serial.println("Scanning available networks..."); + listNetworks(); +} + +void loop() { + delay(10000); + // scan for existing networks: + Serial.println("Scanning available networks..."); + listNetworks(); +} + +void printMacAddress() { + // the MAC address of your WiFi shield + byte mac[6]; + + // print your MAC address: + WiFi.macAddress(mac); + Serial.print("MAC: "); + Serial.print(mac[5], HEX); + Serial.print(":"); + Serial.print(mac[4], HEX); + Serial.print(":"); + Serial.print(mac[3], HEX); + Serial.print(":"); + Serial.print(mac[2], HEX); + Serial.print(":"); + Serial.print(mac[1], HEX); + Serial.print(":"); + Serial.println(mac[0], HEX); +} + +void listNetworks() { + // scan for nearby networks: + Serial.println("** Scan Networks **"); + int numSsid = WiFi.scanNetworks(); + if (numSsid == -1) + { + Serial.println("Couldn't get a wifi connection"); + while (true); + } + + // print the list of networks seen: + Serial.print("number of available networks:"); + Serial.println(numSsid); + + // print the network number and name for each network found: + for (int thisNet = 0; thisNet < numSsid; thisNet++) { + Serial.print(thisNet); + Serial.print(") "); + Serial.print(WiFi.SSID(thisNet)); + Serial.print("\tSignal: "); + Serial.print(WiFi.RSSI(thisNet)); + Serial.print(" dBm"); + Serial.print("\tEncryption: "); + printEncryptionType(WiFi.encryptionType(thisNet)); + Serial.flush(); + } +} + +void printEncryptionType(int thisType) { + // read the encryption type and print out the name: + switch (thisType) { + case ENC_TYPE_WEP: + Serial.println("WEP"); + break; + case ENC_TYPE_TKIP: + Serial.println("WPA"); + break; + case ENC_TYPE_CCMP: + Serial.println("WPA2"); + break; + case ENC_TYPE_NONE: + Serial.println("None"); + break; + case ENC_TYPE_AUTO: + Serial.println("Auto"); + break; + } +} \ No newline at end of file From 747f626598aee0b227903ecb0012318434e99062 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 15 Mar 2018 22:07:12 +0200 Subject: [PATCH 5/9] Fix comment --- examples/arduino-wifi-scan/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/arduino-wifi-scan/platformio.ini b/examples/arduino-wifi-scan/platformio.ini index a69939b..761b663 100644 --- a/examples/arduino-wifi-scan/platformio.ini +++ b/examples/arduino-wifi-scan/platformio.ini @@ -13,5 +13,5 @@ platform = atmelsam board = samd21g18a framework = arduino lib_deps = - ; https://platformio.org/lib/show/299/WiFi101 +; https://platformio.org/lib/show/299/WiFi101 WiFi101 From f534acd5ef383d938dc3118a5d9bf6e6a01d63be Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 20 Mar 2018 18:25:23 +0200 Subject: [PATCH 6/9] New example: WiFi Web Server LED control via web of things --- .travis.yml | 1 + appveyor.yml | 1 + .../.gitignore | 0 .../.travis.yml | 0 .../README.rst | 2 +- .../lib/readme.txt | 0 examples/arduino-web-thing-led/platformio.ini | 33 +++ examples/arduino-web-thing-led/src/main.cpp | 217 ++++++++++++++++++ examples/arduino-wifi-scan/platformio.ini | 17 -- examples/arduino-wifi-scan/src/main.cpp | 122 ---------- platform.json | 2 +- 11 files changed, 254 insertions(+), 141 deletions(-) rename examples/{arduino-wifi-scan => arduino-web-thing-led}/.gitignore (100%) rename examples/{arduino-wifi-scan => arduino-web-thing-led}/.travis.yml (100%) rename examples/{arduino-wifi-scan => arduino-web-thing-led}/README.rst (95%) rename examples/{arduino-wifi-scan => arduino-web-thing-led}/lib/readme.txt (100%) create mode 100644 examples/arduino-web-thing-led/platformio.ini create mode 100644 examples/arduino-web-thing-led/src/main.cpp delete mode 100644 examples/arduino-wifi-scan/platformio.ini delete mode 100644 examples/arduino-wifi-scan/src/main.cpp diff --git a/.travis.yml b/.travis.yml index da8f090..a5a20eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ env: - PLATFORMIO_PROJECT_DIR=examples/arduino-blink - PLATFORMIO_PROJECT_DIR=examples/arduino-external-libs - PLATFORMIO_PROJECT_DIR=examples/arduino-internal-libs + - PLATFORMIO_PROJECT_DIR=examples/arduino-web-thing-led - PLATFORMIO_PROJECT_DIR=examples/mbed-blink - PLATFORMIO_PROJECT_DIR=examples/mbed-dsp # - PLATFORMIO_PROJECT_DIR=examples/mbed-events diff --git a/appveyor.yml b/appveyor.yml index 69f843c..be2ec00 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,6 +5,7 @@ environment: - PLATFORMIO_PROJECT_DIR: "examples/arduino-blink" - PLATFORMIO_PROJECT_DIR: "examples/arduino-external-libs" - PLATFORMIO_PROJECT_DIR: "examples/arduino-internal-libs" + - PLATFORMIO_PROJECT_DIR: "examples/arduino-web-thing-led" - PLATFORMIO_PROJECT_DIR: "examples/mbed-blink" - PLATFORMIO_PROJECT_DIR: "examples/mbed-dsp" # - PLATFORMIO_PROJECT_DIR: "examples/mbed-events" diff --git a/examples/arduino-wifi-scan/.gitignore b/examples/arduino-web-thing-led/.gitignore similarity index 100% rename from examples/arduino-wifi-scan/.gitignore rename to examples/arduino-web-thing-led/.gitignore diff --git a/examples/arduino-wifi-scan/.travis.yml b/examples/arduino-web-thing-led/.travis.yml similarity index 100% rename from examples/arduino-wifi-scan/.travis.yml rename to examples/arduino-web-thing-led/.travis.yml diff --git a/examples/arduino-wifi-scan/README.rst b/examples/arduino-web-thing-led/README.rst similarity index 95% rename from examples/arduino-wifi-scan/README.rst rename to examples/arduino-web-thing-led/README.rst index 2a723d2..2538de5 100644 --- a/examples/arduino-wifi-scan/README.rst +++ b/examples/arduino-web-thing-led/README.rst @@ -20,7 +20,7 @@ How to build PlatformIO based project .. code-block:: bash # Change directory to example - > cd platform-atmelsam/examples/arduino-wifi-scan + > cd platform-atmelsam/examples/arduino-web-thing-led # Build project > platformio run diff --git a/examples/arduino-wifi-scan/lib/readme.txt b/examples/arduino-web-thing-led/lib/readme.txt similarity index 100% rename from examples/arduino-wifi-scan/lib/readme.txt rename to examples/arduino-web-thing-led/lib/readme.txt diff --git a/examples/arduino-web-thing-led/platformio.ini b/examples/arduino-web-thing-led/platformio.ini new file mode 100644 index 0000000..dee7963 --- /dev/null +++ b/examples/arduino-web-thing-led/platformio.ini @@ -0,0 +1,33 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; http://docs.platformio.org/page/projectconf.html + +[platformio] +description = WiFi Web Server LED control via web of things (e.g., iot.mozilla.org gateway) + +; env_default = samw25 +; env_default = mkr1000USB + +[common] +; https://platformio.org/lib/show/299/WiFi101 +lib_deps = WiFi101 + +[env:samw25] +platform = atmelsam +board = samd21g18a +framework = arduino +lib_deps = ${common.lib_deps} +; hook for W25 issue with LED/HIGH +build_flags = -D PIN_STATE_HIGH=0 -D PIN_STATE_LOW=1 + +[env:mkr1000USB] +platform = atmelsam +board = mkr1000USB +framework = arduino +lib_deps = ${common.lib_deps} diff --git a/examples/arduino-web-thing-led/src/main.cpp b/examples/arduino-web-thing-led/src/main.cpp new file mode 100644 index 0000000..de788af --- /dev/null +++ b/examples/arduino-web-thing-led/src/main.cpp @@ -0,0 +1,217 @@ +/* + WiFi Web Server LED control via web of things (e.g., iot.mozilla.org gateway) + based on WiFi101.h example "Provisioning_WiFiWebServer.ino" + + A simple web server that lets you control an LED via the web. + This sketch will print the IP address of your WiFi device (once connected) + to the Serial monitor. From there, you can open that address in a web browser + to turn on and off the onboard LED. + + You can also connect via the Things Gateway http-on-off-wifi-adapter. + + If the IP address of your shield is yourAddress: + http://yourAddress/H turns the LED on + http://yourAddress/L turns it off + + This example is written for a network using WPA encryption. For + WEP or WPA, change the Wifi.begin() call accordingly. + + Circuit: + * WiFi using Microchip (Atmel) WINC1500 + * LED attached to pin 1 (onboard LED) for SAMW25 + * LED attached to pin 6 for MKR1000 + + created 25 Nov 2012 + by Tom Igoe + + updates: dh, kg 2018 + */ + +#include +#include +#include +#include + +#ifndef PIN_STATE_HIGH +#define PIN_STATE_HIGH HIGH +#endif +#ifndef PIN_STATE_LOW +#define PIN_STATE_LOW LOW +#endif + + +char mdnsName[] = "wifi101-XXXXXX"; // the MDNS name that the board will respond to + // after WiFi settings have been provisioned. +// The -XXXXXX will be replaced with the last 6 digits of the MAC address. +// The actual MDNS name will have '.local' after the name above, so +// "wifi101-123456" will be accessible on the MDNS name "wifi101-123456.local". + +byte mac[6]; + +WiFiServer server(80); + +// Create a MDNS responder to listen and respond to MDNS name requests. +WiFiMDNSResponder mdnsResponder; + +void printWiFiStatus(); + +void setup() { + //Initialize serial: + Serial.begin(9600); + + // check for the presence of the shield: + Serial.print("Configuring WiFi shield/module...\n"); + if (WiFi.status() == WL_NO_SHIELD) { + Serial.println("WiFi shield not present"); + // don't continue: + while (true); + } + + // configure the LED pin for output mode + pinMode(LED_BUILTIN, OUTPUT); + + Serial.print("Starting in provisioning mode...\n"); + // Start in provisioning mode: + // 1) This will try to connect to a previously associated access point. + // 2) If this fails, an access point named "wifi101-XXXX" will be created, where XXXX + // is the last 4 digits of the boards MAC address. Once you are connected to the access point, + // you can configure an SSID and password by visiting http://wifi101/ + WiFi.beginProvision(); + + while (WiFi.status() != WL_CONNECTED) { + // wait while not connected + + // blink the led to show an unconnected status + digitalWrite(LED_BUILTIN, PIN_STATE_HIGH); + delay(500); + digitalWrite(LED_BUILTIN, PIN_STATE_LOW); + delay(500); + } + + // connected, make the LED stay on + digitalWrite(LED_BUILTIN, PIN_STATE_HIGH); + + WiFi.macAddress(mac); + // Replace the XXXXXX in wifi101-XXXXXX with the last 6 digits of the MAC address. + if (strcmp(&mdnsName[7], "-XXXXXX") == 0) { + sprintf(&mdnsName[7], "-%.2X%.2X%.2X", mac[2], mac[1], mac[0]); + } + + server.begin(); + + // Setup the MDNS responder to listen to the configured name. + // NOTE: You _must_ call this _after_ connecting to the WiFi network and + // being assigned an IP address. + if (!mdnsResponder.begin(mdnsName)) { + Serial.println("Failed to start MDNS responder!"); + while(1); + } + + Serial.print("Server listening at http://"); + Serial.print(mdnsName); + Serial.println(".local/"); + + // you're connected now, so print out the status: + printWiFiStatus(); +} + +unsigned long lastPrint = 0; + +void loop() { + // Call the update() function on the MDNS responder every loop iteration to + // make sure it can detect and respond to name requests. + mdnsResponder.poll(); + + // listen for incoming clients + WiFiClient client = server.available(); + if (client) { + Serial.println("new client"); + // an http request ends with a blank line + String currentLine = ""; + while (client.connected()) { + if (client.available()) { + char c = client.read(); + Serial.write(c); + // if you've gotten to the end of the line (received a newline + // character) and the line is blank, the http request has ended, + // so you can send a reply + if (c == '\n') { + if (currentLine.length() == 0) { + // if the current line is blank, you got two newline characters in a row. + // that's the end of the client HTTP request, so send a response: + + // send a standard http response header + client.println("HTTP/1.1 200 OK"); + client.println("Content-Type: text/html"); + client.println("Connection: close"); // the connection will be closed after completion of the response + client.println("Refresh: 5"); // refresh the page automatically every 5 sec + client.println(); + client.println(""); + client.println(""); + + // the content of the HTTP response follows the header: + client.print("Click here to turn the LED on
"); + client.print("Click here turn the LED off
"); + + client.println(""); + // break out of the while loop: + break; + } else { + currentLine = ""; + } + } + else if (c != '\r') { + currentLine += c; + } + + // Check to see if the client request was "GET /H" or "GET /L": + if (currentLine.endsWith("GET /H")) { + digitalWrite(LED_BUILTIN, PIN_STATE_HIGH); // GET /H turns the LED on + } + if (currentLine.endsWith("GET /L")) { + digitalWrite(LED_BUILTIN, PIN_STATE_LOW); // GET /L turns the LED off + } + + } + } + // give the web browser time to receive the data + delay(1); + + // close the connection: + client.stop(); + Serial.println("client disonnected"); + } +} + +void printWiFiStatus() { + // print the SSID of the network you're attached to: + Serial.print("SSID: "); + Serial.println(WiFi.SSID()); + + // print your WiFi shield's IP address: + IPAddress ip = WiFi.localIP(); + Serial.print("IP Address: "); + Serial.println(ip); + + Serial.print("MDNS Name: "); + Serial.println(mdnsName); + + Serial.print("Mac: "); + Serial.print(mac[5], HEX); + Serial.print(":"); + Serial.print(mac[4], HEX); + Serial.print(":"); + Serial.print(mac[3], HEX); + Serial.print(":"); + Serial.print(mac[2], HEX); + Serial.print(":"); + Serial.print(mac[1], HEX); + Serial.print(":"); + Serial.println(mac[0], HEX); + + // print the received signal strength: + long rssi = WiFi.RSSI(); + Serial.print("signal strength (RSSI):"); + Serial.print(rssi); + Serial.println(" dBm"); +} diff --git a/examples/arduino-wifi-scan/platformio.ini b/examples/arduino-wifi-scan/platformio.ini deleted file mode 100644 index 761b663..0000000 --- a/examples/arduino-wifi-scan/platformio.ini +++ /dev/null @@ -1,17 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; http://docs.platformio.org/page/projectconf.html - -[env:samd21g18a] -platform = atmelsam -board = samd21g18a -framework = arduino -lib_deps = -; https://platformio.org/lib/show/299/WiFi101 - WiFi101 diff --git a/examples/arduino-wifi-scan/src/main.cpp b/examples/arduino-wifi-scan/src/main.cpp deleted file mode 100644 index 060e1e4..0000000 --- a/examples/arduino-wifi-scan/src/main.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - - This example prints the WiFi shield's MAC address, and - scans for available WiFi networks using the WiFi shield. - Every ten seconds, it scans again. It doesn't actually - connect to any network, so no encryption scheme is specified. - - Circuit: - * WiFi shield attached - - created 13 July 2010 - by dlf (Metodo2 srl) - modified 21 Junn 2012 - by Tom Igoe and Jaymes Dec - */ - - -#include -#include - - -void printMacAddress(); -void listNetworks(); -void printEncryptionType(int thisType); - -void setup() { - //Initialize serial and wait for port to open: - Serial.begin(9600); - while (!Serial) { - ; // wait for serial port to connect. Needed for native USB port only - } - - // check for the presence of the shield: - if (WiFi.status() == WL_NO_SHIELD) { - Serial.println("WiFi shield not present"); - // don't continue: - while (true); - } - - // Print WiFi MAC address: - printMacAddress(); - - // scan for existing networks: - Serial.println("Scanning available networks..."); - listNetworks(); -} - -void loop() { - delay(10000); - // scan for existing networks: - Serial.println("Scanning available networks..."); - listNetworks(); -} - -void printMacAddress() { - // the MAC address of your WiFi shield - byte mac[6]; - - // print your MAC address: - WiFi.macAddress(mac); - Serial.print("MAC: "); - Serial.print(mac[5], HEX); - Serial.print(":"); - Serial.print(mac[4], HEX); - Serial.print(":"); - Serial.print(mac[3], HEX); - Serial.print(":"); - Serial.print(mac[2], HEX); - Serial.print(":"); - Serial.print(mac[1], HEX); - Serial.print(":"); - Serial.println(mac[0], HEX); -} - -void listNetworks() { - // scan for nearby networks: - Serial.println("** Scan Networks **"); - int numSsid = WiFi.scanNetworks(); - if (numSsid == -1) - { - Serial.println("Couldn't get a wifi connection"); - while (true); - } - - // print the list of networks seen: - Serial.print("number of available networks:"); - Serial.println(numSsid); - - // print the network number and name for each network found: - for (int thisNet = 0; thisNet < numSsid; thisNet++) { - Serial.print(thisNet); - Serial.print(") "); - Serial.print(WiFi.SSID(thisNet)); - Serial.print("\tSignal: "); - Serial.print(WiFi.RSSI(thisNet)); - Serial.print(" dBm"); - Serial.print("\tEncryption: "); - printEncryptionType(WiFi.encryptionType(thisNet)); - Serial.flush(); - } -} - -void printEncryptionType(int thisType) { - // read the encryption type and print out the name: - switch (thisType) { - case ENC_TYPE_WEP: - Serial.println("WEP"); - break; - case ENC_TYPE_TKIP: - Serial.println("WPA"); - break; - case ENC_TYPE_CCMP: - Serial.println("WPA2"); - break; - case ENC_TYPE_NONE: - Serial.println("None"); - break; - case ENC_TYPE_AUTO: - Serial.println("Auto"); - break; - } -} \ No newline at end of file diff --git a/platform.json b/platform.json index 0078ffd..2419b66 100644 --- a/platform.json +++ b/platform.json @@ -40,7 +40,7 @@ "framework-arduinosam": { "type": "framework", "optional": true, - "version": "~2.10618.0" + "version": "~2.10618.1" }, "framework-mbed": { "type": "framework", From 9f410f47a981f49fe725b22986fddf2cd1ac0477 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 21 Mar 2018 17:51:24 +0200 Subject: [PATCH 7/9] Don't clone build environment --- builder/frameworks/arduino.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index d4d0f52..9cf77e2 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -134,9 +134,7 @@ join(FRAMEWORK_DIR, "variants", env.BoardConfig().get("build.variant")) )) -envsafe = env.Clone() - -libs.append(envsafe.BuildLibrary( +libs.append(env.BuildLibrary( join("$BUILD_DIR", "FrameworkArduino"), join(FRAMEWORK_DIR, "cores", BUILD_CORE) )) From 6422a1a6f655d6dc4b555bfe27bd6ac529c83309 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 22 Mar 2018 12:32:26 +0200 Subject: [PATCH 8/9] Update arduino-web-thing-led example --- examples/arduino-web-thing-led/platformio.ini | 5 +- examples/arduino-web-thing-led/src/main.cpp | 56 ++++++++++++++++++- 2 files changed, 58 insertions(+), 3 deletions(-) mode change 100644 => 100755 examples/arduino-web-thing-led/platformio.ini mode change 100644 => 100755 examples/arduino-web-thing-led/src/main.cpp diff --git a/examples/arduino-web-thing-led/platformio.ini b/examples/arduino-web-thing-led/platformio.ini old mode 100644 new mode 100755 index dee7963..324e313 --- a/examples/arduino-web-thing-led/platformio.ini +++ b/examples/arduino-web-thing-led/platformio.ini @@ -16,7 +16,10 @@ description = WiFi Web Server LED control via web of things (e.g., iot.mozilla.o [common] ; https://platformio.org/lib/show/299/WiFi101 -lib_deps = WiFi101 +; https://platformio.org/lib/show/2848/ArduinoMDNS +lib_deps = + WiFi101 + ArduinoMDNS [env:samw25] platform = atmelsam diff --git a/examples/arduino-web-thing-led/src/main.cpp b/examples/arduino-web-thing-led/src/main.cpp old mode 100644 new mode 100755 index de788af..1420304 --- a/examples/arduino-web-thing-led/src/main.cpp +++ b/examples/arduino-web-thing-led/src/main.cpp @@ -1,4 +1,4 @@ -/* +/* WiFi Web Server LED control via web of things (e.g., iot.mozilla.org gateway) based on WiFi101.h example "Provisioning_WiFiWebServer.ino" @@ -30,7 +30,15 @@ #include #include #include + +#define USE_MDNS_RESPONDER 0 + +#if USE_MDNS_RESPONDER #include +#else +#include +#include +#endif #ifndef PIN_STATE_HIGH #define PIN_STATE_HIGH HIGH @@ -50,8 +58,13 @@ byte mac[6]; WiFiServer server(80); +#if USE_MDNS_RESPONDER // Create a MDNS responder to listen and respond to MDNS name requests. WiFiMDNSResponder mdnsResponder; +#else +WiFiUDP udp; +MDNS mdns(udp); +#endif void printWiFiStatus(); @@ -99,6 +112,7 @@ void setup() { server.begin(); +#if USE_MDNS_RESPONDER // Setup the MDNS responder to listen to the configured name. // NOTE: You _must_ call this _after_ connecting to the WiFi network and // being assigned an IP address. @@ -106,6 +120,32 @@ void setup() { Serial.println("Failed to start MDNS responder!"); while(1); } +#else + // Initialize the mDNS library. You can now reach or ping this + // Arduino via the host name "arduino.local", provided that your operating + // system is mDNS/Bonjour-enabled (such as MacOS X). + // Always call this before any other method! + mdns.begin(WiFi.localIP(), mdnsName); + + // Now let's register the service we're offering (a web service) via Bonjour! + // To do so, we call the addServiceRecord() method. The first argument is the + // name of our service instance and its type, separated by a dot. In this + // case, the service type is _http. There are many other service types, use + // google to look up some common ones, but you can also invent your own + // service type, like _mycoolservice - As long as your clients know what to + // look for, you're good to go. + // The second argument is the port on which the service is running. This is + // port 80 here, the standard HTTP port. + // The last argument is the protocol type of the service, either TCP or UDP. + // Of course, our service is a TCP service. + // With the service registered, it will show up in a mDNS/Bonjour-enabled web + // browser. As an example, if you are using Apple's Safari, you will now see + // the service under Bookmarks -> Bonjour (Provided that you have enabled + // Bonjour in the "Bookmarks" preferences in Safari). + mdns.addServiceRecord("http-on-off._http", + 80, + MDNSServiceTCP); +#endif Serial.print("Server listening at http://"); Serial.print(mdnsName); @@ -118,9 +158,21 @@ void setup() { unsigned long lastPrint = 0; void loop() { +#if USE_MDNS_RESPONDER // Call the update() function on the MDNS responder every loop iteration to // make sure it can detect and respond to name requests. mdnsResponder.poll(); +#else + mdns.run(); +#endif + + // print wifi status every 30 seconds + unsigned long now = millis(); + if ((now - lastPrint) > 30000) { + lastPrint = now; + Serial.println(""); + printWiFiStatus(); + } // listen for incoming clients WiFiClient client = server.available(); @@ -151,7 +203,7 @@ void loop() { // the content of the HTTP response follows the header: client.print("Click here to turn the LED on
"); - client.print("Click here turn the LED off
"); + client.print("Click here to turn the LED off
"); client.println(""); // break out of the while loop: From 7fc2009549d916e4e4d0a8ac1249a6bb28a3875b Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 22 Mar 2018 12:34:20 +0200 Subject: [PATCH 9/9] Bump version to 3.1.0 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 2419b66..7ed681b 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/platformio/platform-atmelsam.git" }, - "version": "3.0.0", + "version": "3.1.0", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json",