初始化提交
This commit is contained in:
61
arduino-cli/libraries/Blynk/extras/BLE.json
Normal file
61
arduino-cli/libraries/Blynk/extras/BLE.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"Nordic UART": {
|
||||
"devices": "Arduino 101, nRF8001 BLE module, RedBearLab Blend Micro, ...",
|
||||
"type": "ble raw",
|
||||
"uuid_svc": "6e400001-b5a3-f393-e0a9-e50e24dcca9e",
|
||||
"uuid_tx": "6e400003-b5a3-f393-e0a9-e50e24dcca9e",
|
||||
"uuid_rx": "6e400002-b5a3-f393-e0a9-e50e24dcca9e"
|
||||
},
|
||||
"RedBear UART": {
|
||||
"devices": "nRF51822, RedBearLab BLE Nano, RedBearLab BLE Mini ...",
|
||||
"type": "ble raw",
|
||||
"uuid_svc": "713d0000-503e-4c75-ba94-3148f18d941e",
|
||||
"uuid_tx": "713d0002-503e-4c75-ba94-3148f18d941e",
|
||||
"uuid_rx": "713d0003-503e-4c75-ba94-3148f18d941e"
|
||||
},
|
||||
"Simblee": {
|
||||
"devices": "Sparkfun Simblee, Lilypad Simblee, ...",
|
||||
"type": "ble raw",
|
||||
"uuid_svc": "0000fe84-0000-1000-8000-00805f9b34fb",
|
||||
"uuid_tx": "2d30c082-f39f-4ce6-923f-3484ea480596",
|
||||
"uuid_rx": "2d30c083-f39f-4ce6-923f-3484ea480596"
|
||||
},
|
||||
"RFDuino": {
|
||||
"devices": "RFDuino BLE",
|
||||
"type": "ble raw",
|
||||
"uuid_svc": "00002220-0000-1000-8000-00805f9b34fb",
|
||||
"uuid_tx": "00002221-0000-1000-8000-00805f9b34fb",
|
||||
"uuid_rx": "00002222-0000-1000-8000-00805f9b34fb"
|
||||
},
|
||||
"DFRobot BLE-Link": {
|
||||
"devices": "BLE-Link, Bluno, ...",
|
||||
"type": "ble raw",
|
||||
"uuid_svc": "0000dfb0-0000-1000-8000-00805f9b34fb",
|
||||
"uuid_rxtx":"0000dfb1-0000-1000-8000-00805f9b34fb"
|
||||
},
|
||||
"Microduino": {
|
||||
"devices": "Microduino, mCookie",
|
||||
"type": "ble raw",
|
||||
"uuid_svc": "0000fff0-0000-1000-8000-00805f9b34fb",
|
||||
"uuid_rxtx":"0000fff6-0000-1000-8000-00805f9b34fb"
|
||||
},
|
||||
"HM-10": {
|
||||
"devices": "HM-10",
|
||||
"type": "ble raw",
|
||||
"uuid_svc": "0000ffe0-0000-1000-8000-00805f9b34fb",
|
||||
"uuid_rxtx":"0000ffe1-0000-1000-8000-00805f9b34fb"
|
||||
},
|
||||
|
||||
|
||||
|
||||
"LightBlue Bean": {
|
||||
"devices": "LightBlue Bean, Bean+",
|
||||
"type": "ble lbb",
|
||||
"uuid_svc": "a495ff10-c5b1-4b44-b512-1370f02d74de",
|
||||
"uuid_rxtx":"a495ff11-c5b1-4b44-b512-1370f02d74de"
|
||||
},
|
||||
"HC-05": {
|
||||
"devices": "HC-05, HC-06, ...",
|
||||
"type": "bt serial"
|
||||
}
|
||||
}
|
||||
254
arduino-cli/libraries/Blynk/extras/all-boards.json
Normal file
254
arduino-cli/libraries/Blynk/extras/all-boards.json
Normal file
@@ -0,0 +1,254 @@
|
||||
{
|
||||
"_stats": {
|
||||
"built": 214,
|
||||
"failed": 21
|
||||
},
|
||||
"broken": [
|
||||
"energia:cc3200:CC3200-LAUNCHXL",
|
||||
"energia:cc3200:CC3200-RBL",
|
||||
"energia:cc3200:CC3200-RBL-MICRO",
|
||||
"energia:cc3200:CC3200-RBL-MINI",
|
||||
"energia:msp432:MSP-EXP432P401R",
|
||||
"stm32duino:STM32F1:mapleRET6",
|
||||
"stm32duino:STM32F4:netduino2plus"
|
||||
],
|
||||
"built": [
|
||||
"Intel:arc32:arduino_101",
|
||||
"Intel:i586:izmir_fd",
|
||||
"Intel:i586:izmir_fg",
|
||||
"Intel:i686:izmir_ec",
|
||||
"LinkIt:avr:smart7688",
|
||||
"Microduino:avr:1284p",
|
||||
"Microduino:avr:128rfa116m",
|
||||
"Microduino:avr:168p",
|
||||
"Microduino:avr:328p",
|
||||
"Microduino:avr:32u416m",
|
||||
"Microduino:avr:644p",
|
||||
"RFduino:RFduino:RFduino",
|
||||
"RedBear:STM32F2:RedBear_Duo",
|
||||
"RedBear:STM32F2:RedBear_Duo_native",
|
||||
"RedBear:avr:blend",
|
||||
"RedBear:avr:blendmicro16",
|
||||
"RedBear:avr:blendmicro8",
|
||||
"RedBear:nRF51822:nRF51822",
|
||||
"RedBear:nRF51822:nRF51822_32KB",
|
||||
"RedBear:nRF51822:nRF51822_NANO",
|
||||
"RedBear:nRF51822:nRF51822_NANO_32KB",
|
||||
"Simblee:Simblee:Simblee",
|
||||
"WildFire- 4.0.0:avr:wildfiredo3",
|
||||
"WildFire- 4.0.0:avr:wildfireo3",
|
||||
"WildFire- 4.0.0:avr:wildfirev2",
|
||||
"adafruit:avr:adafruit32u4",
|
||||
"adafruit:avr:bluefruitmicro",
|
||||
"adafruit:avr:circuitplay32u4cat",
|
||||
"adafruit:avr:feather32u4",
|
||||
"adafruit:avr:flora8",
|
||||
"adafruit:avr:gemma",
|
||||
"adafruit:avr:metro",
|
||||
"adafruit:avr:protrinket3",
|
||||
"adafruit:avr:protrinket3ftdi",
|
||||
"adafruit:avr:protrinket5",
|
||||
"adafruit:avr:protrinket5ftdi",
|
||||
"adafruit:avr:trinket3",
|
||||
"adafruit:avr:trinket5",
|
||||
"arduino:arm_cortexA:artik10",
|
||||
"arduino:arm_cortexA:artik5",
|
||||
"arduino:arm_cortexA:artik530",
|
||||
"arduino:arm_cortexA:artik5_v05",
|
||||
"arduino:arm_cortexA:artik710",
|
||||
"arduino:avr:LilyPadUSB",
|
||||
"arduino:avr:atmegang",
|
||||
"arduino:avr:bt",
|
||||
"arduino:avr:chiwawa",
|
||||
"arduino:avr:circuitplay32u4cat",
|
||||
"arduino:avr:diecimila",
|
||||
"arduino:avr:esplora",
|
||||
"arduino:avr:ethernet",
|
||||
"arduino:avr:fio",
|
||||
"arduino:avr:gemma",
|
||||
"arduino:avr:leonardo",
|
||||
"arduino:avr:leonardoeth",
|
||||
"arduino:avr:lilypad",
|
||||
"arduino:avr:mega",
|
||||
"arduino:avr:megaADK",
|
||||
"arduino:avr:micro",
|
||||
"arduino:avr:mini",
|
||||
"arduino:avr:nano",
|
||||
"arduino:avr:one",
|
||||
"arduino:avr:pro",
|
||||
"arduino:avr:robotControl",
|
||||
"arduino:avr:robotMotor",
|
||||
"arduino:avr:uno",
|
||||
"arduino:avr:unowifi",
|
||||
"arduino:avr:yun",
|
||||
"arduino:avr:yunmini",
|
||||
"arduino:sam:arduino_due_x",
|
||||
"arduino:sam:arduino_due_x_dbg",
|
||||
"arduino:samd:adafruit_circuitplayground_m0",
|
||||
"arduino:samd:arduino_zero_edbg",
|
||||
"arduino:samd:arduino_zero_native",
|
||||
"arduino:samd:mkr1000",
|
||||
"arduino:samd:mkrfox1200",
|
||||
"arduino:samd:mkrzero",
|
||||
"arduino:samd:mzero_bl",
|
||||
"arduino:samd:mzero_pro_bl",
|
||||
"arduino:samd:mzero_pro_bl_dbg",
|
||||
"arduino:samd:tian",
|
||||
"attiny:avr:ATtinyX4",
|
||||
"attiny:avr:ATtinyX5",
|
||||
"chipKIT:pic32:CUI32stem",
|
||||
"chipKIT:pic32:Fubarino_SDZ",
|
||||
"chipKIT:pic32:Olimex_Pinguino32",
|
||||
"chipKIT:pic32:cerebot32mx4",
|
||||
"chipKIT:pic32:cerebot32mx7",
|
||||
"chipKIT:pic32:cerebot_mx3ck",
|
||||
"chipKIT:pic32:cerebot_mx3ck_512",
|
||||
"chipKIT:pic32:cerebot_mx4ck",
|
||||
"chipKIT:pic32:cerebot_mx7ck",
|
||||
"chipKIT:pic32:chipkit_DP32",
|
||||
"chipKIT:pic32:chipkit_Pi",
|
||||
"chipKIT:pic32:chipkit_Pi_USB_Serial",
|
||||
"chipKIT:pic32:chipkit_WF32",
|
||||
"chipKIT:pic32:chipkit_WiFire",
|
||||
"chipKIT:pic32:chipkit_WiFire_80MHz",
|
||||
"chipKIT:pic32:chipkit_WiFire_AB",
|
||||
"chipKIT:pic32:chipkit_mx3",
|
||||
"chipKIT:pic32:chipkit_pro_mx4",
|
||||
"chipKIT:pic32:chipkit_pro_mx7",
|
||||
"chipKIT:pic32:chipkit_uc32",
|
||||
"chipKIT:pic32:clicker2",
|
||||
"chipKIT:pic32:cmod",
|
||||
"chipKIT:pic32:cui32",
|
||||
"chipKIT:pic32:flipnclickmz",
|
||||
"chipKIT:pic32:fubarino_mini",
|
||||
"chipKIT:pic32:fubarino_mini_dev",
|
||||
"chipKIT:pic32:fubarino_sd",
|
||||
"chipKIT:pic32:fubarino_sd_seeed",
|
||||
"chipKIT:pic32:lenny",
|
||||
"chipKIT:pic32:mega_pic32",
|
||||
"chipKIT:pic32:mega_usb_pic32",
|
||||
"chipKIT:pic32:picadillo_35t",
|
||||
"chipKIT:pic32:pontech_NoFire",
|
||||
"chipKIT:pic32:quick240_usb_pic32",
|
||||
"chipKIT:pic32:ubw32_mx460",
|
||||
"chipKIT:pic32:ubw32_mx795",
|
||||
"chipKIT:pic32:uc32_pmod",
|
||||
"chipKIT:pic32:uno_pic32",
|
||||
"chipKIT:pic32:usbono_pic32",
|
||||
"digistump:avr:digispark-pro",
|
||||
"digistump:avr:digispark-pro32",
|
||||
"digistump:avr:digispark-pro64",
|
||||
"digistump:avr:digispark-tiny",
|
||||
"digistump:avr:digispark-tiny1",
|
||||
"digistump:avr:digispark-tiny16",
|
||||
"digistump:avr:digispark-tiny8",
|
||||
"digistump:oak:oak",
|
||||
"digistump:oak:oak1",
|
||||
"digistump:oak:oak1_noauto",
|
||||
"energia:cc3200:CC3200-LAUNCHXL",
|
||||
"energia:cc3200:CC3200-RBL",
|
||||
"energia:cc3200:CC3200-RBL-MICRO",
|
||||
"energia:cc3200:CC3200-RBL-MINI",
|
||||
"energia:msp430:MSP-EXP430F5529LP",
|
||||
"energia:msp430:MSP-EXP430FR4133LP",
|
||||
"energia:msp430:MSP-EXP430FR5739LP",
|
||||
"energia:msp430:MSP-EXP430FR5969LP",
|
||||
"energia:msp430:MSP-EXP430FR5994LP",
|
||||
"energia:msp430:MSP-EXP430FR6989LP",
|
||||
"energia:msp430:MSP-EXP430G2553LP",
|
||||
"energia:msp432:MSP-EXP432P401R",
|
||||
"energia:msp432r:MSP-EXP432P401RR",
|
||||
"energia:tivac:EK-LM4F120XL",
|
||||
"energia:tivac:EK-TM4C123GXL",
|
||||
"energia:tivac:EK-TM4C1294XL",
|
||||
"esp8266:esp8266:arduino-esp8266",
|
||||
"esp8266:esp8266:coredev",
|
||||
"esp8266:esp8266:d1",
|
||||
"esp8266:esp8266:d1_mini",
|
||||
"esp8266:esp8266:esp210",
|
||||
"esp8266:esp8266:esp8285",
|
||||
"esp8266:esp8266:espduino",
|
||||
"esp8266:esp8266:espino",
|
||||
"esp8266:esp8266:espinotee",
|
||||
"esp8266:esp8266:espresso_lite_v1",
|
||||
"esp8266:esp8266:espresso_lite_v2",
|
||||
"esp8266:esp8266:gen4iod",
|
||||
"esp8266:esp8266:generic",
|
||||
"esp8266:esp8266:huzzah",
|
||||
"esp8266:esp8266:modwifi",
|
||||
"esp8266:esp8266:nodemcu",
|
||||
"esp8266:esp8266:nodemcuv2",
|
||||
"esp8266:esp8266:oak",
|
||||
"esp8266:esp8266:phoenix_v1",
|
||||
"esp8266:esp8266:phoenix_v2",
|
||||
"esp8266:esp8266:thing",
|
||||
"esp8266:esp8266:thingdev",
|
||||
"esp8266:esp8266:wifinfo",
|
||||
"konekt:sam:dash",
|
||||
"konekt:sam:dashpro",
|
||||
"konekt:sam:dashpro_beta",
|
||||
"sandeepmistry:nRF5:BBCmicrobit",
|
||||
"sandeepmistry:nRF5:BLENano",
|
||||
"sandeepmistry:nRF5:BLENano2",
|
||||
"sandeepmistry:nRF5:Beacon_PCA20006",
|
||||
"sandeepmistry:nRF5:Blend2",
|
||||
"sandeepmistry:nRF5:BluzDK",
|
||||
"sandeepmistry:nRF5:Generic_nRF51822",
|
||||
"sandeepmistry:nRF5:Generic_nRF52832",
|
||||
"sandeepmistry:nRF5:OSHChip",
|
||||
"sandeepmistry:nRF5:PCA1000X",
|
||||
"sandeepmistry:nRF5:RedBearLab_nRF51822",
|
||||
"sandeepmistry:nRF5:STCT_nRF52_minidev",
|
||||
"sandeepmistry:nRF5:TinyBLE",
|
||||
"sandeepmistry:nRF5:Waveshare_BLE400",
|
||||
"sandeepmistry:nRF5:bluey",
|
||||
"sandeepmistry:nRF5:nRF51Dongle",
|
||||
"sandeepmistry:nRF5:nRF52DK",
|
||||
"sandeepmistry:nRF5:ng_beacon",
|
||||
"stm32duino:STM32F1:STM32VLD",
|
||||
"stm32duino:STM32F1:genericSTM32F103C",
|
||||
"stm32duino:STM32F1:genericSTM32F103R",
|
||||
"stm32duino:STM32F1:genericSTM32F103V",
|
||||
"stm32duino:STM32F1:genericSTM32F103Z",
|
||||
"stm32duino:STM32F1:hytiny-stm32f103t",
|
||||
"stm32duino:STM32F1:maple",
|
||||
"stm32duino:STM32F1:mapleMini",
|
||||
"stm32duino:STM32F1:mapleRET6",
|
||||
"stm32duino:STM32F1:microduino32_flash",
|
||||
"stm32duino:STM32F1:nucleo_f103rb",
|
||||
"stm32duino:STM32F4:discovery_f407",
|
||||
"stm32duino:STM32F4:generic_f407v",
|
||||
"stm32duino:STM32F4:netduino2plus",
|
||||
"stm32duino:STM32F4:stm32f4stamp",
|
||||
"teensy:avr:teensy2",
|
||||
"teensy:avr:teensy30",
|
||||
"teensy:avr:teensy31",
|
||||
"teensy:avr:teensy35",
|
||||
"teensy:avr:teensy36",
|
||||
"teensy:avr:teensyLC",
|
||||
"teensy:avr:teensypp2"
|
||||
],
|
||||
"failed": [
|
||||
"LightBlue-Bean:avr:bean",
|
||||
"LightBlue-Bean:avr:beanplus",
|
||||
"Microduino:avr:mddevice",
|
||||
"arduino:samd:tian_cons",
|
||||
"chipKIT:pic32:OpenScope",
|
||||
"chipKIT:pic32:openbci",
|
||||
"chipKIT:pic32:uno_pmod",
|
||||
"energia:cc3200:CC3200-LAUNCHXL",
|
||||
"energia:cc3200:CC3200-RBL",
|
||||
"energia:cc3200:CC3200-RBL-MICRO",
|
||||
"energia:cc3200:CC3200-RBL-MINI",
|
||||
"energia:cc3220emt:CC3220S-LAUNCHXL",
|
||||
"energia:cc3220emt:CC3220SF-LAUNCHXL",
|
||||
"energia:msp430:MSP-EXP430G2231LP",
|
||||
"energia:msp430:MSP-EXP430G2452LP",
|
||||
"energia:msp432:MSP-EXP432P401R",
|
||||
"stm32duino:STM32F1:genericGD32F103C",
|
||||
"stm32duino:STM32F1:genericSTM32F103T",
|
||||
"stm32duino:STM32F1:mapleRET6",
|
||||
"stm32duino:STM32F3:discovery_f3",
|
||||
"stm32duino:STM32F4:netduino2plus"
|
||||
]
|
||||
}
|
||||
200
arduino-cli/libraries/Blynk/extras/build-boards.py
Normal file
200
arduino-cli/libraries/Blynk/extras/build-boards.py
Normal file
@@ -0,0 +1,200 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os, sys, fnmatch
|
||||
from subprocess import call
|
||||
import json
|
||||
import re
|
||||
|
||||
arduino_ide_path = os.environ['ARDUINO_IDE_PATH']
|
||||
energia_ide_path = os.environ['ENERGIA_IDE_PATH']
|
||||
|
||||
''' Arduino Board Manager URLs:
|
||||
https://github.com/esp8266/Arduino/releases/download/2.4.0-rc2/package_esp8266com_index.json
|
||||
https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
|
||||
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
|
||||
http://digistump.com/package_digistump_index.json
|
||||
http://download.labs.mediatek.com/package_mtk_linkit_index.json
|
||||
http://download.labs.mediatek.com/package_mtk_linkit_smart_7688_index.json
|
||||
https://redbearlab.github.io/arduino/package_redbearlab_index.json
|
||||
https://redbearlab.github.io/arduino/package_redbear_index.json
|
||||
http://downloads.konekt.io/arduino/package_konekt_index.json
|
||||
https://www.simblee.com/package_simblee_index.json
|
||||
https://github.com/chipKIT32/chipKIT-core/raw/master/package_chipkit_index.json
|
||||
http://rfduino.com/package_rfduino_index.json
|
||||
https://github.com/wasdpkj/Microduino-IDE-Support/raw/master/package_Microduino_index.json
|
||||
https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json
|
||||
http://downloads.arduino.cc/packages/package_arduino.cc_linux_index.json
|
||||
https://sandeepmistry.github.io/arduino-nRF5/package_nRF5_boards_index.json
|
||||
http://dan.drown.org/stm32duino/package_STM32duino_index.json
|
||||
http://update.wickeddevice.com/package_WildFireBSP-4.0.0_index.json
|
||||
'''
|
||||
|
||||
def find_files(directory, pattern):
|
||||
for root, dirs, files in os.walk(directory):
|
||||
for basename in files:
|
||||
if fnmatch.fnmatch(basename, pattern):
|
||||
filename = os.path.join(root, basename)
|
||||
yield filename
|
||||
|
||||
hardware = os.path.expanduser('~') + '/.arduino15/packages/'
|
||||
boards = find_files(hardware, 'boards.txt')
|
||||
|
||||
hardware2 = arduino_ide_path + '/hardware/'
|
||||
boards2 = find_files(hardware2, 'boards.txt')
|
||||
|
||||
hardware3 = os.path.expanduser('~') + '/.energia15/packages/'
|
||||
boards3 = find_files(hardware3, 'boards.txt')
|
||||
|
||||
hardware4 = energia_ide_path + '/hardware/'
|
||||
boards4 = find_files(hardware4, 'boards.txt')
|
||||
|
||||
boards = list(boards) + list(boards2) + list(boards3) + list(boards4)
|
||||
boards = filter(lambda x: -1 == x.find('variants'), boards)
|
||||
|
||||
fqbns = []
|
||||
for b in boards:
|
||||
folders = b.replace(hardware,'').replace(hardware2,'').replace(hardware3,'').replace(hardware4,'')
|
||||
folders = folders.split('/')
|
||||
if len(folders) == 3:
|
||||
fqbn = [ folders[i] for i in [0, 1] ]
|
||||
else:
|
||||
fqbn = [ folders[i] for i in [0, 2] ]
|
||||
|
||||
lastname = "#"
|
||||
with open(b) as f:
|
||||
for line in f.readlines():
|
||||
if ".name=" in line:
|
||||
line=line.strip()
|
||||
names = line.split(".name=")
|
||||
if names[0].startswith('#'):
|
||||
continue
|
||||
|
||||
lastname = names[0]
|
||||
name = names[1]
|
||||
fqbns.append({
|
||||
'name': name,
|
||||
'fqbn': ':'.join(fqbn + [lastname])
|
||||
})
|
||||
elif line.startswith(lastname + ".menu."):
|
||||
line = line.split('.menu.')[1]
|
||||
line = line.split('=')[0]
|
||||
line = line.split('.')
|
||||
fbqn = fqbns[-1]
|
||||
if not "opts" in fbqn:
|
||||
fbqn["opts"] = {}
|
||||
if not line[0] in fbqn["opts"]:
|
||||
fbqn["opts"][line[0]] = line[1]
|
||||
|
||||
advanced_boards = {
|
||||
"attiny:avr:ATtinyX5" : ":cpu=attiny85,clock=internal16",
|
||||
"attiny:avr:ATtinyX4" : ":cpu=attiny84,clock=internal8",
|
||||
}
|
||||
|
||||
for x in fqbns:
|
||||
if x['fqbn'] in advanced_boards.keys():
|
||||
x['fqbn_adv'] = x['fqbn'] + advanced_boards[x['fqbn']]
|
||||
elif 'opts' in x:
|
||||
opts = ""
|
||||
for o in x['opts'].keys():
|
||||
opts += o + '=' + x['opts'][o] + ','
|
||||
|
||||
x['fqbn_adv'] = x['fqbn'] + ":" + opts.strip(',')
|
||||
|
||||
#print json.dumps(fqbns, sort_keys=True, indent=2)
|
||||
#exit(0)
|
||||
|
||||
logfile = open("./build.log","wb")
|
||||
datafile = os.path.abspath('./extras/all-boards.json')
|
||||
fn = os.path.abspath('./tests/BlynkBuildTest/BlynkBuildTest.ino')
|
||||
|
||||
try:
|
||||
with open(datafile, 'r') as fp:
|
||||
json_data = json.load(fp)
|
||||
except:
|
||||
json_data = {}
|
||||
json_data.setdefault('failed', [])
|
||||
json_data.setdefault('built', [])
|
||||
json_data.setdefault('skip', [])
|
||||
data = {
|
||||
'failed': set(json_data['failed']),
|
||||
'built': set(json_data['built']),
|
||||
}
|
||||
|
||||
skip_boards = [
|
||||
# Hello world fails:
|
||||
"chipKIT:pic32:OpenScope",
|
||||
"chipKIT:pic32:openbci",
|
||||
"chipKIT:pic32:uno_pmod",
|
||||
"stm32duino:STM32F1:genericGD32F103C",
|
||||
"stm32duino:STM32F1:genericSTM32F103T",
|
||||
|
||||
# __FlashString problem:
|
||||
"digistump:avr:digispark-tiny*",
|
||||
|
||||
# No c++0x:
|
||||
"stm32duino:STM32F3:discovery_f3",
|
||||
]
|
||||
|
||||
skip_boards = "(" + ")|(".join(skip_boards) + ")"
|
||||
|
||||
fqbns.sort(key=lambda x: x['fqbn'] in data['built'])
|
||||
|
||||
for m in fqbns:
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
if m['fqbn'] != sys.argv[1]:
|
||||
continue
|
||||
elif re.match(skip_boards, m['fqbn']):
|
||||
continue
|
||||
|
||||
print "Building:", m['name'], " (", m['fqbn'], ")", " ...",
|
||||
sys.stdout.flush()
|
||||
|
||||
print >>logfile, "\n\n", "================="
|
||||
print >>logfile, "Building:", m['name'], " (", m['fqbn'], ")"
|
||||
print >>logfile, "=================", "\n"
|
||||
logfile.flush()
|
||||
|
||||
if m["fqbn"].startswith("energia:"):
|
||||
os.chdir(energia_ide_path)
|
||||
builder = "./energia"
|
||||
else:
|
||||
os.chdir(arduino_ide_path)
|
||||
builder = "./arduino"
|
||||
|
||||
fqbn = m["fqbn_adv"] if "fqbn_adv" in m.keys() else m["fqbn"]
|
||||
cmd = [
|
||||
builder,
|
||||
"--verbose",
|
||||
"--verify",
|
||||
"--board", fqbn,
|
||||
fn
|
||||
]
|
||||
#print cmd
|
||||
rc = call(cmd, stdout=logfile, stderr=logfile)
|
||||
if rc:
|
||||
print "Failed"
|
||||
data['failed'].add(m["fqbn"])
|
||||
else:
|
||||
print "OK"
|
||||
data['built'].add(m["fqbn"])
|
||||
if m["fqbn"] in data['failed']:
|
||||
data['failed'].remove(m["fqbn"])
|
||||
|
||||
|
||||
with open(datafile, 'w') as fp:
|
||||
json.dump({
|
||||
'_stats': {
|
||||
'failed': len(data['failed']),
|
||||
'built': len(data['built']),
|
||||
},
|
||||
'failed': sorted(list(data['failed'])),
|
||||
'built': sorted(list(data['built'])),
|
||||
'broken': sorted(data['built'].intersection(data['failed'])),
|
||||
}, fp, sort_keys=True, indent=4)
|
||||
|
||||
print "=================="
|
||||
if len(data['built']):
|
||||
print " OK: ", len(data['built'])
|
||||
if len(data['failed']):
|
||||
print " Fail:", len(data['failed'])
|
||||
192
arduino-cli/libraries/Blynk/extras/build-examples.py
Normal file
192
arduino-cli/libraries/Blynk/extras/build-examples.py
Normal file
@@ -0,0 +1,192 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os, sys, fnmatch
|
||||
from subprocess import call
|
||||
|
||||
arduino_ide_path = os.environ['ARDUINO_IDE_PATH']
|
||||
energia_ide_path = os.environ['ENERGIA_IDE_PATH']
|
||||
|
||||
ESP8266 = { "fqbn": "esp8266:esp8266:nodemcuv2:CpuFrequency=80,FlashSize=4M3M" }
|
||||
|
||||
metadata = {
|
||||
"Arduino_Yun.ino" : { "fqbn": "arduino:avr:yun" },
|
||||
"Arduino_Zero_M0_Serial.ino" : { "fqbn": "arduino:samd:arduino_zero_native" },
|
||||
"ENC28J60.ino" : { "fqbn": "arduino:avr:nano:cpu=atmega328" },
|
||||
"ESP8266_Shield.ino" : { "fqbn": "arduino:avr:mega:cpu=atmega2560" },
|
||||
"RN_XV_WiFly.ino" : { "fqbn": "arduino:avr:leonardo" },
|
||||
"Serial_HM10_HC08.ino" : { "fqbn": "arduino:avr:leonardo" },
|
||||
"Adafruit_Feather_32u4_BLE.ino": { "fqbn": "adafruit:avr:feather32u4" },
|
||||
"Seeed_EthernetV2_0.ino" : { "fqbn": "arduino:avr:uno" },
|
||||
|
||||
# arduino.org
|
||||
"Arduino_Ethernet2.ino" : { "skip": True },
|
||||
"Arduino_org_UNO_WiFi.ino" : { "fqbn": "arduino:avr:unowifi" },
|
||||
|
||||
# ESP8266
|
||||
"Sparkfun_Blynk_Board.ino" : ESP8266,
|
||||
"NodeMCU.ino" : ESP8266,
|
||||
"ESP8266_DirectConnect.ino" : ESP8266,
|
||||
"ESP8266_Standalone.ino" : ESP8266,
|
||||
"ESP8266_Standalone_Manual_IP.ino" : ESP8266,
|
||||
"ESP8266_Standalone_SmartConfig.ino" : ESP8266,
|
||||
"ESP8266_Standalone_SSL.ino" : ESP8266,
|
||||
|
||||
"ESP8266_Station.ino" : ESP8266,
|
||||
"ESP8266_AccessPoint.ino" : ESP8266,
|
||||
"ESP8266_WiFi.ino" : ESP8266,
|
||||
|
||||
"ESP32_WiFi.ino" : { "fqbn": "espressif:esp32:esp32:FlashMode=qio,FlashFreq=80,FlashSize=4M" },
|
||||
|
||||
"myPlant_ESP8266.ino" : ESP8266,
|
||||
"Template_ESP8266.ino" : ESP8266,
|
||||
"Template_MKR1000.ino" : { "fqbn": "arduino:samd:mkr1000" },
|
||||
|
||||
# TheAirBoard
|
||||
"TheAirBoard_WiFly.ino" : { "fqbn": "arduino:avr:fio" },
|
||||
"TheAirBoard_BLE_Link.ino" : { "fqbn": "arduino:avr:fio" },
|
||||
|
||||
# Digistump
|
||||
"Digistump_Digispark.ino" : { "fqbn": "digistump:avr:digispark-pro" },
|
||||
"Digistump_Oak.ino" : { "fqbn": "digistump:oak:oak1:CpuFrequency=80,UploadTool=oak_ota,FlashSize=OAK,RomConfig=Full" },
|
||||
|
||||
# Intel
|
||||
"Intel_Edison_WiFi.ino" : { "fqbn": "Intel:i686:izmir_ec" },
|
||||
"Intel_Galileo.ino" : { "fqbn": "Intel:i586:izmir_fg" },
|
||||
"Arduino_101_BLE.ino" : { "fqbn": "Intel:arc32:arduino_101" },
|
||||
|
||||
# RBL
|
||||
"RedBear_Duo_WiFi.ino" : { "fqbn": "RedBear:STM32F2:RedBear_Duo" },
|
||||
"RedBear_Duo_BLE.ino" : { "fqbn": "RedBear:STM32F2:RedBear_Duo" },
|
||||
"RedBearLab_BLE_Nano.ino" : { "fqbn": "RedBear:nRF51822:nRF51822_NANO_32KB" },
|
||||
"RedBearLab_BlendMicro.ino" : { "fqbn": "RedBear:avr:blendmicro8" },
|
||||
"RedBearLab_BLE_Mini.ino" : { "fqbn": "arduino:avr:leonardo" },
|
||||
|
||||
# GSM
|
||||
"SIM800_SIM900.ino" : { "fqbn": "arduino:avr:leonardo" },
|
||||
|
||||
#Other
|
||||
"Blue_Pill_STM32F103C.ino" : { "fqbn": "stm32duino:STM32F1:genericSTM32F103C:device_variant=STM32F103C8" },
|
||||
"Fishino.ino" : { "skip": True }, # requires extra lib
|
||||
"BBC_MicroBit.ino" : { "fqbn": "sandeepmistry:nRF5:BBCmicrobit:softdevice=s130" },
|
||||
"Simblee_BLE.ino" : { "fqbn": "Simblee:Simblee:Simblee" },
|
||||
"RFDuino_BLE.ino" : { "fqbn": "RFduino:RFduino:RFduino" },
|
||||
"DFRobot_Bluno_BLE_Link.ino" : { "fqbn": "arduino:avr:leonardo" },
|
||||
"Microduino_BLE.ino" : { "fqbn": "arduino:avr:leonardo" },
|
||||
"TinyDuino_WiFi.ino" : { "fqbn": "arduino:avr:pro:cpu=8MHzatmega328" },
|
||||
"WildFire_V3.ino" : { "fqbn": "WildFire- 4.0.0:avr:wildfireo3" },
|
||||
"WildFire_V4.ino" : { "fqbn": "WildFire- 4.0.0:avr:wildfireo3" },
|
||||
"chipKIT_Uno32.ino" : { "fqbn": "chipKIT:pic32:uno_pic32" },
|
||||
"LightBlue_Bean.ino" : { "fqbn": "LightBlue-Bean:avr:beanplus" },
|
||||
"Teensy3.ino" : { "fqbn": "teensy:avr:teensy31:usb=serial,speed=96,opt=o2std,keys=en-us" },
|
||||
"ATtiny85.ino" : { "fqbn": "attiny:avr:ATtinyX5:cpu=attiny85,clock=internal8" },
|
||||
|
||||
# Special examples
|
||||
"ESP8266.ino" : ESP8266,
|
||||
"HandleDisconnect.ino" : ESP8266,
|
||||
|
||||
# No linux support
|
||||
"LinkItONE.ino" : { "skip": True },
|
||||
|
||||
# Energia
|
||||
"Energia_WiFi.ino" : { "fqbn": "energia:msp430:MSP-EXP430F5529LP" },
|
||||
"Energia_BLE.ino" : { "fqbn": "energia:msp432r:MSP-EXP432P401RR" },
|
||||
"Energia_Ethernet.ino" : { "fqbn": "energia:tivac:EK-TM4C1294XL" },
|
||||
"Energia_Serial_USB.ino" : { "fqbn": "energia:tivac:EK-LM4F120XL" },
|
||||
}
|
||||
|
||||
def find_files(directory, pattern):
|
||||
for root, dirs, files in os.walk(directory):
|
||||
for basename in files:
|
||||
if fnmatch.fnmatch(basename, pattern):
|
||||
filename = os.path.join(root, basename)
|
||||
yield filename
|
||||
|
||||
examples = find_files('examples', '*.ino')
|
||||
abs_examples = map(lambda x: os.path.abspath(x), examples)
|
||||
|
||||
logfile = open("./build.log","wb")
|
||||
|
||||
'''
|
||||
builder = "./arduino-builder"
|
||||
|
||||
builder_args = [
|
||||
"-verbose",
|
||||
|
||||
"-hardware", "./hardware",
|
||||
"-hardware", os.path.expanduser("~/.arduino15/packages/"),
|
||||
"-hardware", "/data2/sketchbook/hardware",
|
||||
|
||||
"-tools", "./hardware/tools",
|
||||
"-tools", os.path.expanduser("~/.arduino15/packages/"),
|
||||
"-tools", "./tools-builder",
|
||||
|
||||
"-libraries",os.path.expanduser("~/.arduino15/packages/"),
|
||||
"-libraries","./libraries",
|
||||
"-libraries","/data2/sketchbook/libraries/",
|
||||
]
|
||||
'''
|
||||
|
||||
failed = []
|
||||
built = []
|
||||
skipped = []
|
||||
|
||||
for fn in abs_examples:
|
||||
path, ino = os.path.split(fn)
|
||||
|
||||
if ino in metadata:
|
||||
m = metadata[ino]
|
||||
m['sketch_found'] = True
|
||||
if "skip" in m:
|
||||
skipped.append(ino)
|
||||
continue
|
||||
if not "fqbn" in m:
|
||||
m["fqbn"] = "arduino:avr:uno"
|
||||
else:
|
||||
#continue
|
||||
m = { "fqbn": "arduino:avr:uno" }
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
if ino != sys.argv[1]:
|
||||
continue
|
||||
|
||||
print >>logfile, "\n\n", "================="
|
||||
print >>logfile, "Building:", ino
|
||||
print >>logfile, "=================", "\n"
|
||||
logfile.flush()
|
||||
|
||||
print "Building:", ino, "...",
|
||||
sys.stdout.flush()
|
||||
|
||||
if m["fqbn"].startswith("energia:"):
|
||||
os.chdir(energia_ide_path)
|
||||
builder = "./energia"
|
||||
else:
|
||||
os.chdir(arduino_ide_path)
|
||||
builder = "./arduino"
|
||||
|
||||
cmd = [
|
||||
builder,
|
||||
"--verbose",
|
||||
"--verify",
|
||||
"--board", m["fqbn"],
|
||||
fn
|
||||
]
|
||||
#print cmd
|
||||
rc = call(cmd, stdout=logfile, stderr=logfile)
|
||||
if rc:
|
||||
print "Failed"
|
||||
failed.append(ino)
|
||||
else:
|
||||
print "OK"
|
||||
built.append(ino)
|
||||
|
||||
print "=================="
|
||||
if len(failed):
|
||||
print " Failed:", failed
|
||||
sys.exit(1)
|
||||
else:
|
||||
print " All", len(built), "examples OK"
|
||||
|
||||
for ino, m in metadata.items():
|
||||
if not 'sketch_found' in m:
|
||||
print "Sketch not found:", ino
|
||||
3
arduino-cli/libraries/Blynk/extras/docs/README.md
Normal file
3
arduino-cli/libraries/Blynk/extras/docs/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## Please take a look at:
|
||||
[Blynk Firmware documentation](http://docs.blynk.cc/#blynk-firmware)
|
||||
[Blynk Help Center](http://help.blynk.cc)
|
||||
2355
arduino-cli/libraries/Blynk/extras/doxygen.config
Normal file
2355
arduino-cli/libraries/Blynk/extras/doxygen.config
Normal file
File diff suppressed because it is too large
Load Diff
28
arduino-cli/libraries/Blynk/extras/formatter.conf
Normal file
28
arduino-cli/libraries/Blynk/extras/formatter.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
# This configuration file contains a selection of the available options provided by the formatting tool "Artistic Style"
|
||||
# http://astyle.sourceforge.net/astyle.html
|
||||
#
|
||||
# If you wish to change them, don't edit this file.
|
||||
# Instead, copy it in the same folder of file "preferences.txt" and modify the copy. This way, you won't lose your custom formatter settings when upgrading the IDE
|
||||
# If you don't know where file preferences.txt is stored, open the IDE, File -> Preferences and you'll find a link
|
||||
|
||||
# 2 spaces indentation
|
||||
indent=spaces=2
|
||||
|
||||
# also indent macros
|
||||
indent-preproc-block
|
||||
|
||||
# indent classes, switches (and cases), comments starting at column 1
|
||||
indent-classes
|
||||
indent-switches
|
||||
indent-cases
|
||||
indent-col1-comments
|
||||
|
||||
# put a space around operators
|
||||
pad-oper
|
||||
|
||||
# put a space after if/for/while
|
||||
pad-header
|
||||
|
||||
# if you like one-liners, keep them
|
||||
keep-one-line-statements
|
||||
|
||||
21
arduino-cli/libraries/Blynk/extras/gcc-predefined.py
Normal file
21
arduino-cli/libraries/Blynk/extras/gcc-predefined.py
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import fileinput
|
||||
|
||||
def cmdfilter(cmd):
|
||||
for el in cmd:
|
||||
el = el.strip()
|
||||
if el == '-c': continue
|
||||
if el == '-o': continue
|
||||
if el.startswith('/tmp/'): continue
|
||||
yield el
|
||||
|
||||
for line in fileinput.input():
|
||||
line = line.strip('[]')
|
||||
line = line.split(',')
|
||||
line = list(cmdfilter(line))
|
||||
line = ' '.join(line) + ' -dM -E - < /dev/null | sort'
|
||||
os.system(line)
|
||||
38
arduino-cli/libraries/Blynk/extras/gen-qr.py
Normal file
38
arduino-cli/libraries/Blynk/extras/gen-qr.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# coding: utf-8
|
||||
import sys
|
||||
import pyqrcode
|
||||
import gzip, zlib
|
||||
import base64
|
||||
import json
|
||||
import re
|
||||
|
||||
#data = sys.argv[1]
|
||||
|
||||
data = '''{"boardType":"Generic Board","createdAt":1453325389643,"id":17,"isActive":false,"isShared":false,"keepScreenOn":false,"name":"webpage","updatedAt":1453326512172,"widgets":[{"color":616861439,"pushMode":false,"pin":1,"pinType":"VIRTUAL","height":2,"id":1,"label":"","type":"BUTTON","value":"0","width":2,"x":0,"y":0},{"color":-26804225,"splitMode":false,"pins":[{"max":255,"min":0,"pin":0,"pinType":"VIRTUAL","pwmMode":false,"rangeMappingOn":false},{"max":255,"min":0,"pin":0,"pinType":"VIRTUAL","pwmMode":false,"rangeMappingOn":false},{"max":255,"min":0,"pin":0,"pinType":"VIRTUAL","pwmMode":false,"rangeMappingOn":false}],"height":3,"id":2,"type":"RGB","value":"-104705","width":4,"x":2,"y":0},{"notifyWhenOffline":false,"priority":"high","height":1,"id":3,"type":"NOTIFICATION","width":2,"x":0,"y":2}]}'''
|
||||
|
||||
# Compact JSON
|
||||
#data = json.loads(data)
|
||||
#data = json.dumps(data, separators=(',',':'))
|
||||
|
||||
# Compress
|
||||
data = str.encode(data, 'utf-8')
|
||||
|
||||
data = zlib.compress(data)
|
||||
#data = gzip.compress(data)
|
||||
data = base64.b64encode(data)
|
||||
data = bytes.decode(data)
|
||||
|
||||
# Add header
|
||||
data = 'bp1' + data
|
||||
|
||||
# Generate QR
|
||||
url = pyqrcode.create(data, error='M', version=None, mode='binary')
|
||||
data = url.text(quiet_zone=4)
|
||||
data = data.replace("0"," ")
|
||||
data = data.replace("1","██")
|
||||
|
||||
# Clean trailing spaces
|
||||
data = re.sub(r'\s+$', '', data, 0, re.M)
|
||||
|
||||
print(data)
|
||||
#print('\x1b[6;30;47m' + data + '\x1b[0m')
|
||||
41
arduino-cli/libraries/Blynk/extras/gen-states.py
Normal file
41
arduino-cli/libraries/Blynk/extras/gen-states.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# coding: utf-8
|
||||
import numpy as np
|
||||
from PIL import Image, ImageDraw
|
||||
from math import sin,cos
|
||||
from numpngw import write_apng
|
||||
|
||||
W,H = 1024,1024
|
||||
|
||||
|
||||
COLOR_BLACK = (0x00, 0x00, 0x00, 0x00)
|
||||
COLOR_WHITE = (0xF0, 0xF0, 0xE0)
|
||||
COLOR_BLUE = (0x0D, 0x36, 0xFF)
|
||||
COLOR_BLYNK = (0x2E, 0xFF, 0xB9)
|
||||
COLOR_RED = (0xFF, 0x10, 0x08)
|
||||
COLOR_MAGENTA = (0xA7, 0x00, 0xFF)
|
||||
|
||||
def fr(color):
|
||||
im = Image.new('RGBA', (W,H))
|
||||
surface = ImageDraw.Draw(im)
|
||||
surface.ellipse((10,10,W-20,H-20), fill=color)
|
||||
del surface
|
||||
return np.array(im.resize((16,16), Image.ANTIALIAS))
|
||||
|
||||
def fade(color):
|
||||
frames = []
|
||||
for i in range(25):
|
||||
frames.append(fr(color + tuple([int(i*(255.0/25))])))
|
||||
for i in range(25):
|
||||
frames.append(fr(color + tuple([255-int(i*(255.0/25))])))
|
||||
return frames
|
||||
|
||||
path = "./docs/images/states/"
|
||||
write_apng(path + "0.png", map(fr,[COLOR_BLUE, COLOR_BLACK]), delay=[50, 500])
|
||||
write_apng(path + "1.png", map(fr,[COLOR_BLUE, COLOR_BLACK]), delay=[200, 200])
|
||||
write_apng(path + "2.png", map(fr,[COLOR_BLYNK, COLOR_BLACK]), delay=[50, 500])
|
||||
write_apng(path + "3.png", map(fr,[COLOR_BLYNK, COLOR_BLACK]), delay=[100, 100])
|
||||
write_apng(path + "4.png", fade(COLOR_BLYNK), delay=100)
|
||||
write_apng(path + "5.png", map(fr,[COLOR_MAGENTA, COLOR_BLACK]), delay=[50, 50])
|
||||
write_apng(path + "6.png", map(fr,[COLOR_RED, COLOR_BLACK, COLOR_RED, COLOR_BLACK]), delay=[80, 100, 80, 1000])
|
||||
write_apng(path + "7.png", fade(COLOR_WHITE), delay=50)
|
||||
write_apng(path + "8.png", map(fr,[COLOR_WHITE, COLOR_BLACK]), delay=[100, 100])
|
||||
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* @file BlynkUpdater.java
|
||||
* @author Volodymyr Shymanskyy
|
||||
* @license This project is released under the MIT License (MIT)
|
||||
* @copyright Copyright (c) 2016 Volodymyr Shymanskyy
|
||||
* @date Dec 2016
|
||||
* @brief
|
||||
*
|
||||
* It is not permitted to use this source code for other purposes,
|
||||
* except running scripts of original Blynk library.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.github.blynk.arduino.tools;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.lang.Runnable;
|
||||
import java.lang.Thread;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import processing.app.Editor;
|
||||
import processing.app.PreferencesData;
|
||||
import processing.app.tools.Tool;
|
||||
|
||||
import processing.app.BaseNoGui;
|
||||
import processing.app.I18n;
|
||||
import processing.app.helpers.OSUtils;
|
||||
import processing.app.helpers.FileUtils;
|
||||
import processing.app.helpers.PreferencesMap;
|
||||
import processing.app.Base;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.DefaultCaret;
|
||||
import java.nio.file.*;
|
||||
|
||||
import processing.app.Theme;
|
||||
|
||||
import static processing.app.I18n.tr;
|
||||
import processing.app.I18n;
|
||||
|
||||
public class BlynkExampleBuilder implements Tool {
|
||||
private Editor editor;
|
||||
|
||||
public void init(Editor editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public String getMenuTitle() {
|
||||
return "Blynk: Example Builder";
|
||||
}
|
||||
|
||||
public void run() {
|
||||
Runnable runnable = () -> {
|
||||
try {
|
||||
Base.openURL(tr("http://examples.blynk.cc/"));
|
||||
} catch (Exception e) {
|
||||
editor.statusError("Blynk cannot open Example Builder");
|
||||
System.err.println(e);
|
||||
//e.printStackTrace(System.err);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
Thread thread = new Thread(runnable);
|
||||
thread.start();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
259
arduino-cli/libraries/Blynk/extras/ide-tools/BlynkUpdater.java
Normal file
259
arduino-cli/libraries/Blynk/extras/ide-tools/BlynkUpdater.java
Normal file
@@ -0,0 +1,259 @@
|
||||
/**
|
||||
* @file BlynkUpdater.java
|
||||
* @author Volodymyr Shymanskyy
|
||||
* @license This project is released under the MIT License (MIT)
|
||||
* @copyright Copyright (c) 2016 Volodymyr Shymanskyy
|
||||
* @date Dec 2016
|
||||
* @brief
|
||||
*
|
||||
* It is not permitted to use this source code for other purposes,
|
||||
* except original Blynk library installation.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.github.blynk.arduino.tools;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.net.URL;
|
||||
import java.lang.Runnable;
|
||||
import java.lang.Thread;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import processing.app.Editor;
|
||||
import processing.app.PreferencesData;
|
||||
import processing.app.tools.Tool;
|
||||
|
||||
import processing.app.BaseNoGui;
|
||||
import processing.app.I18n;
|
||||
import processing.app.helpers.FileUtils;
|
||||
import processing.app.helpers.PreferencesMap;
|
||||
import processing.app.Base;
|
||||
import processing.app.tools.ZipDeflater;
|
||||
|
||||
import cc.arduino.contributions.libraries.ContributedLibrary;
|
||||
import cc.arduino.contributions.filters.InstalledPredicate;
|
||||
import cc.arduino.contributions.VersionComparator;
|
||||
|
||||
import static processing.app.I18n.tr;
|
||||
|
||||
public class BlynkUpdater implements Tool {
|
||||
private Editor editor;
|
||||
final String lib_url = "https://raw.githubusercontent.com/blynkkk/blynk-library/master/library.properties";
|
||||
|
||||
public void init(Editor editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public String getMenuTitle() {
|
||||
return "Blynk: Check for updates";
|
||||
}
|
||||
|
||||
private static ByteArrayOutputStream downloadFile(String url) throws IOException {
|
||||
System.out.println("Downloading '" + url + "'");
|
||||
System.out.print("...");
|
||||
|
||||
final int retries = 3;
|
||||
for (int i=0; i<retries; i++) {
|
||||
try {
|
||||
InputStream is = new URL(url).openStream();
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
|
||||
byte[] chunk = new byte[32 * 1024];
|
||||
int bytesRead;
|
||||
|
||||
while ((bytesRead = is.read(chunk)) > 0) {
|
||||
System.out.print(".");
|
||||
outputStream.write(chunk, 0, bytesRead);
|
||||
}
|
||||
System.out.println(" done.");
|
||||
return outputStream;
|
||||
} catch (Exception e) {
|
||||
if (i == retries-1) {
|
||||
throw(e);
|
||||
}
|
||||
try { Thread.sleep(1000); } catch (Exception _e) {}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static boolean isSymlink(File file) throws IOException {
|
||||
if (file == null)
|
||||
throw new NullPointerException("File must not be null");
|
||||
File canon;
|
||||
if (file.getParent() == null) {
|
||||
canon = file;
|
||||
} else {
|
||||
File canonDir = file.getParentFile().getCanonicalFile();
|
||||
canon = new File(canonDir, file.getName());
|
||||
}
|
||||
return !canon.getCanonicalFile().equals(canon.getAbsoluteFile());
|
||||
}
|
||||
|
||||
private static void updateFolder(File[] components, File tgtFolder) throws IOException {
|
||||
for (File f: components) {
|
||||
File tgt = new File(tgtFolder, f.getName());
|
||||
if (isSymlink(tgt)) {
|
||||
System.out.println("Skipping " + f.getName() + " [symlink]");
|
||||
} else {
|
||||
System.out.println("Updating " + f.getName());
|
||||
|
||||
final int retries = 3;
|
||||
for (int i=0; i<retries; i++) {
|
||||
try {
|
||||
FileUtils.recursiveDelete(tgt);
|
||||
tgt.mkdir();
|
||||
FileUtils.copy(f, tgt);
|
||||
break;
|
||||
} catch (Exception e) {
|
||||
if (i == retries-1) {
|
||||
throw(e);
|
||||
}
|
||||
System.out.println("Retry.");
|
||||
try { Thread.sleep(1000); } catch (Exception _e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String getLatestVersion() throws IOException {
|
||||
ByteArrayOutputStream last_lib_os = downloadFile(lib_url);
|
||||
ByteArrayInputStream last_lib_is = new ByteArrayInputStream(last_lib_os.toByteArray());
|
||||
PreferencesMap properties = new PreferencesMap();
|
||||
properties.load(last_lib_is);
|
||||
return properties.get("version");
|
||||
}
|
||||
|
||||
public void run() {
|
||||
|
||||
Thread thread = new Thread(() -> {
|
||||
try {
|
||||
BaseNoGui.librariesIndexer.rescanLibraries();
|
||||
final File sketchbook_path = new File(PreferencesData.get("sketchbook.path"));
|
||||
final File ide_path = new File(PreferencesData.get("runtime.ide.path"));
|
||||
|
||||
final String last_version = getLatestVersion();
|
||||
System.out.println("Latest version: " + last_version);
|
||||
|
||||
List<ContributedLibrary> blynk_libs = BaseNoGui.librariesIndexer.getIndex().find("Blynk").stream().filter(new InstalledPredicate()).collect(Collectors.toList());
|
||||
if (blynk_libs.size() > 1) {
|
||||
JOptionPane.showMessageDialog(editor,
|
||||
tr("Multiple Blynk libraries found!\n\nPlease reinstall libraries manually."),
|
||||
tr("Error"),
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
boolean needUpdate = true;
|
||||
if (blynk_libs.size() == 1) {
|
||||
ContributedLibrary installed = blynk_libs.get(0);
|
||||
|
||||
System.out.println("Installed version: " + installed.getVersion());
|
||||
final VersionComparator versionComparator = new VersionComparator();
|
||||
needUpdate = versionComparator.greaterThan(last_version, installed.getParsedVersion());
|
||||
}
|
||||
|
||||
if (!needUpdate) {
|
||||
Base.showMessage(tr("No update needed"), tr("Blynk is up to date!"));
|
||||
return;
|
||||
}
|
||||
|
||||
{ // Ask for update
|
||||
Object[] options = { tr("Yes"), tr("No") };
|
||||
int result = JOptionPane.showOptionDialog(editor,
|
||||
"Blynk v" + last_version + " is available.\n" +
|
||||
"Do you want to update?",
|
||||
tr("Update"),
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
JOptionPane.QUESTION_MESSAGE,
|
||||
null,
|
||||
options,
|
||||
options[0]);
|
||||
if (result != JOptionPane.YES_OPTION) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
final String zip_fn = "Blynk_Release_v" + last_version;
|
||||
final String zip_url = "https://github.com/blynkkk/blynk-library/releases/download/v" + last_version + "/" + zip_fn + ".zip";
|
||||
|
||||
ByteArrayOutputStream zip_os = downloadFile(zip_url);
|
||||
File tmpFolder = null;
|
||||
try {
|
||||
tmpFolder = FileUtils.createTempFolder();
|
||||
|
||||
{
|
||||
File tmpFile = new File(tmpFolder, zip_fn + ".zip");
|
||||
try(OutputStream outputStream = new FileOutputStream(tmpFile)) {
|
||||
zip_os.writeTo(outputStream);
|
||||
}
|
||||
System.out.println("Unpacking to " + tmpFolder);
|
||||
ZipDeflater zipDeflater = new ZipDeflater(tmpFile, tmpFolder);
|
||||
zipDeflater.deflate();
|
||||
|
||||
zip_os = null;
|
||||
zipDeflater = null;
|
||||
}
|
||||
|
||||
File tmpUnpackedFolder = new File(tmpFolder, zip_fn);
|
||||
|
||||
// Update libs
|
||||
File tgtLibsFolder = new File(sketchbook_path, "libraries");
|
||||
File tmpLibsFolder = new File(tmpUnpackedFolder, "libraries");
|
||||
updateFolder(tmpLibsFolder.listFiles(), tgtLibsFolder);
|
||||
|
||||
// Update tools
|
||||
File tgtToolsFolder = new File(sketchbook_path, "tools");
|
||||
File tmpToolsFolder = new File(tmpUnpackedFolder, "tools");
|
||||
if (tmpToolsFolder.exists()) {
|
||||
updateFolder(tmpToolsFolder.listFiles(), tgtToolsFolder);
|
||||
}
|
||||
|
||||
BaseNoGui.librariesIndexer.rescanLibraries();
|
||||
|
||||
{ // Ask for a star
|
||||
Object[] options = { tr("Yes"), tr("Not now") };
|
||||
int result = JOptionPane.showOptionDialog(editor,
|
||||
"Blynk libraries are succesfully updated!\n\n" +
|
||||
"Would you like to give us a star on github?",
|
||||
tr("Update"),
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
JOptionPane.INFORMATION_MESSAGE,
|
||||
null,
|
||||
options,
|
||||
options[0]);
|
||||
if (result == JOptionPane.YES_OPTION) {
|
||||
Base.openURL(tr("https://github.com/blynkkk/blynk-library/releases/latest"));
|
||||
}
|
||||
}
|
||||
|
||||
editor.statusNotice("Blynk libraries updated.");
|
||||
} catch (IOException e) {
|
||||
JOptionPane.showMessageDialog(editor,
|
||||
tr("Failed to update Blynk libraries! ;(\n\nLibrary may not work properly.\nPlease re-run the update tool later, or try installing update manually."),
|
||||
tr("Update"),
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
throw(e);
|
||||
} finally {
|
||||
// delete zip created temp folder, if exists
|
||||
if (tmpFolder != null) {
|
||||
FileUtils.recursiveDelete(tmpFolder);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
editor.statusError("Blynk update failed");
|
||||
System.err.println(e);
|
||||
//e.printStackTrace(System.err);
|
||||
return;
|
||||
}
|
||||
});
|
||||
thread.start();
|
||||
}
|
||||
}
|
||||
157
arduino-cli/libraries/Blynk/extras/ide-tools/BlynkUsbScript.java
Normal file
157
arduino-cli/libraries/Blynk/extras/ide-tools/BlynkUsbScript.java
Normal file
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* @file BlynkUpdater.java
|
||||
* @author Volodymyr Shymanskyy
|
||||
* @license This project is released under the MIT License (MIT)
|
||||
* @copyright Copyright (c) 2016 Volodymyr Shymanskyy
|
||||
* @date Dec 2016
|
||||
* @brief
|
||||
*
|
||||
* It is not permitted to use this source code for other purposes,
|
||||
* except running scripts of original Blynk library.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.github.blynk.arduino.tools;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.lang.Runnable;
|
||||
import java.lang.Thread;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import processing.app.Editor;
|
||||
import processing.app.PreferencesData;
|
||||
import processing.app.tools.Tool;
|
||||
|
||||
import processing.app.BaseNoGui;
|
||||
import processing.app.I18n;
|
||||
import processing.app.helpers.OSUtils;
|
||||
import processing.app.helpers.FileUtils;
|
||||
import processing.app.helpers.PreferencesMap;
|
||||
import processing.app.Base;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.DefaultCaret;
|
||||
import java.nio.file.*;
|
||||
|
||||
import processing.app.Theme;
|
||||
|
||||
import static processing.app.I18n.tr;
|
||||
import processing.app.I18n;
|
||||
|
||||
public class BlynkUsbScript implements Tool {
|
||||
private Editor editor;
|
||||
|
||||
public void init(Editor editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public String getMenuTitle() {
|
||||
return "Blynk: Run USB script";
|
||||
}
|
||||
|
||||
private void captureIO(final InputStream src, JTextArea textArea) {
|
||||
new Thread(() -> {
|
||||
Scanner sc = new Scanner(src);
|
||||
while (sc.hasNextLine()) {
|
||||
textArea.append(sc.nextLine() + "\n");
|
||||
}
|
||||
//} catch (IOException e) {
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void run() {
|
||||
Runnable runnable = () -> {
|
||||
try {
|
||||
//this.editor.serialMonitor.suspend();
|
||||
Font consoleFont = Theme.getFont("console.font");
|
||||
Font editorFont = PreferencesData.getFont("editor.font");
|
||||
Font font = Theme.scale(new Font(consoleFont.getName(), consoleFont.getStyle(), editorFont.getSize()));
|
||||
|
||||
String warning = "Ensure that Serial Monitor and Plotter are closed when using this tool.\n" +
|
||||
"It uses same port and speed as Serial Monitor\n\n";
|
||||
|
||||
String serial_port = PreferencesData.get("serial.port");
|
||||
String serial_debug_rate = PreferencesData.get("serial.debug_rate");
|
||||
String sketchbook_path = PreferencesData.get("sketchbook.path");
|
||||
|
||||
Path blynk_path = Paths.get(sketchbook_path, "libraries", "Blynk");
|
||||
|
||||
String full_cmd;
|
||||
if (OSUtils.isWindows()) {
|
||||
String script = "blynk-ser.bat";
|
||||
Path script_path = Paths.get(blynk_path.toString(), "scripts", script);
|
||||
|
||||
String args = " -c " + serial_port + " -b " + serial_debug_rate;
|
||||
full_cmd = "echo." + warning.replace("\n"," & echo.") + " & \"" + script_path.toString() + "\"" + args;
|
||||
full_cmd = "cmd /C start \"Blynk\" cmd /C \"" + full_cmd + "\"";
|
||||
|
||||
//System.err.println(full_cmd);
|
||||
|
||||
final Process p = Runtime.getRuntime().exec(full_cmd);
|
||||
|
||||
p.waitFor();
|
||||
p.destroy();
|
||||
} else {
|
||||
|
||||
String script = "blynk-ser.sh";
|
||||
Path script_path = Paths.get(blynk_path.toString(), "scripts", script);
|
||||
|
||||
String args = " -c " + serial_port + " -b " + serial_debug_rate;
|
||||
full_cmd = script_path.toString() + args;
|
||||
|
||||
//System.err.println(full_cmd);
|
||||
|
||||
JTextArea textArea = new JTextArea(warning);
|
||||
textArea.setRows(16);
|
||||
textArea.setColumns(120);
|
||||
textArea.setEditable(false);
|
||||
textArea.setLineWrap(true);
|
||||
textArea.setFont(font);
|
||||
|
||||
DefaultCaret caret = (DefaultCaret)textArea.getCaret();
|
||||
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
|
||||
|
||||
textArea.setCaretPosition(textArea.getDocument().getLength());
|
||||
|
||||
JScrollPane scrollPane = new JScrollPane(textArea);
|
||||
//scrollPane.setPreferredSize( new Dimension(textArea.getPreferredSize().width, 500 ) );
|
||||
|
||||
JFrame frame = new JFrame(script + args);
|
||||
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||
frame.getContentPane().add(scrollPane, BorderLayout.CENTER);
|
||||
frame.pack();
|
||||
frame.setVisible(true);
|
||||
|
||||
final Process p = Runtime.getRuntime().exec(full_cmd);
|
||||
|
||||
captureIO(p.getInputStream(), textArea);
|
||||
captureIO(p.getErrorStream(), textArea);
|
||||
|
||||
frame.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent windowEvent) {
|
||||
p.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
p.waitFor();
|
||||
p.destroy();
|
||||
frame.setVisible(false);
|
||||
frame.dispose();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
editor.statusError("Blynk USB script failed");
|
||||
System.err.println(e);
|
||||
//e.printStackTrace(System.err);
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
Thread thread = new Thread(runnable);
|
||||
thread.start();
|
||||
}
|
||||
}
|
||||
20
arduino-cli/libraries/Blynk/extras/ide-tools/build.sh
Normal file
20
arduino-cli/libraries/Blynk/extras/ide-tools/build.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$ARDUINO_IDE_PATH" ]; then
|
||||
echo "ARDUINO_IDE_PATH not defined"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "$ARDUINO_IDE_PATH" ]; then
|
||||
echo "$ARDUINO_IDE_PATH does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
IDE_LIB_PATH=$ARDUINO_IDE_PATH/lib
|
||||
|
||||
TGT_DIR=./$1/tool/
|
||||
TMP_DIR=./build_$1/
|
||||
rm -rf $TGT_DIR $TMP_DIR
|
||||
mkdir -p $TGT_DIR $TMP_DIR
|
||||
javac -target 1.8 -cp "$IDE_LIB_PATH/pde.jar:$IDE_LIB_PATH/arduino-core.jar" -d $TMP_DIR $1.java && jar cvf $TGT_DIR/$1.jar -C $TMP_DIR .
|
||||
rm -rf $TMP_DIR
|
||||
6
arduino-cli/libraries/Blynk/extras/logo.txt
Normal file
6
arduino-cli/libraries/Blynk/extras/logo.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
|
||||
___ __ __
|
||||
/ _ )/ /_ _____ / /__
|
||||
/ _ / / // / _ \/ '_/
|
||||
/____/_/\_, /_//_/_/\_\
|
||||
/___/
|
||||
148
arduino-cli/libraries/Blynk/extras/travis-generate.py
Normal file
148
arduino-cli/libraries/Blynk/extras/travis-generate.py
Normal file
@@ -0,0 +1,148 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import fnmatch
|
||||
import os
|
||||
|
||||
ESP8266 = { "board": "nodemcuv2" }
|
||||
ESP32 = { "board": "esp32dev", "framework": "arduino" } # "lib_deps": "ESP32 BLE Arduino" }
|
||||
|
||||
metadata = {
|
||||
"Arduino_Yun.ino" : { "board": "yun" },
|
||||
"Arduino_Zero_M0_Serial.ino" : { "board": "zero" },
|
||||
"ENC28J60.ino" : { "board": "nanoatmega328" },
|
||||
"ESP8266_Shield.ino" : { "board": "megaatmega2560" },
|
||||
"RN_XV_WiFly.ino" : { "board": "leonardo" },
|
||||
"Serial_HM10_HC08.ino" : { "board": "leonardo" },
|
||||
"Adafruit_Feather_32u4_BLE.ino": { "board": "feather32u4", "lib_deps": "SoftwareSerial" },
|
||||
"Seeed_EthernetV2_0.ino" : { "skip": True }, # Breaks build
|
||||
|
||||
# arduino.org
|
||||
"Arduino_Ethernet2.ino" : { "skip": True },
|
||||
|
||||
# ESP8266
|
||||
"Sparkfun_Blynk_Board.ino" : ESP8266,
|
||||
"NodeMCU.ino" : ESP8266,
|
||||
"ESP8266_DirectConnect.ino" : ESP8266,
|
||||
"ESP8266_Standalone.ino" : ESP8266,
|
||||
"ESP8266_Standalone_Manual_IP.ino" : ESP8266,
|
||||
"ESP8266_Standalone_SmartConfig.ino" : ESP8266,
|
||||
"ESP8266_Standalone_SSL.ino" : ESP8266,
|
||||
|
||||
"ESP8266_Station.ino" : ESP8266,
|
||||
"ESP8266_AccessPoint.ino" : ESP8266,
|
||||
"ESP8266_WiFi.ino" : ESP8266,
|
||||
|
||||
"myPlant_ESP8266.ino" : { "board": "nodemcuv2", "build_flags": "-DBOARD_LED_PIN_WS2812 -DUSE_TICKER"},
|
||||
"Template_ESP8266.ino" : { "board": "nodemcuv2" , "build_flags": "-DBOARD_LED_PIN_WS2812 -DUSE_TICKER"},
|
||||
"Template_MKR1000.ino" : { "board": "mkr1000USB", "build_flags": "-DUSE_TIMER_FIVE", "lib_deps": "WiFi101"},
|
||||
|
||||
"Arduino_MKR1000.ino" : { "board": "mkr1000USB", "lib_deps": "WiFi101" },
|
||||
"Adafruit_Feather_M0_WiFi.ino": { "board": "adafruit_feather_m0", "lib_deps": "SPI, WiFi101" },
|
||||
"Arduino_WiFi_Shield_101.ino" : { "board": "uno", "lib_deps": "WiFi101" },
|
||||
"WizFi310.ino" : { "board": "uno", "lib_deps": "WizFi310" },
|
||||
"Arduino_org_UNO_WiFi.ino" : { "board": "uno", "lib_deps": "WiFi Link", "build_flags": "-DESP_CH_SPI" },
|
||||
|
||||
# ESP32
|
||||
"ESP32_WiFi.ino" : ESP32,
|
||||
"ESP32_BLE.ino" : ESP32,
|
||||
|
||||
# TheAirBoard
|
||||
"TheAirBoard_WiFly.ino" : { "skip": True, "board": "fio" }, # No AirBoard library
|
||||
"TheAirBoard_BLE_Link.ino" : { "skip": True, "board": "fio" }, # No AirBoard library
|
||||
|
||||
# Digistump
|
||||
"Digistump_Digispark.ino" : { "board": "digispark-pro" },
|
||||
"Digistump_Oak.ino" : { "skip": True },
|
||||
|
||||
# Intel
|
||||
"Intel_Edison_WiFi.ino" : { "skip": True },
|
||||
"Intel_Galileo.ino" : { "skip": True },
|
||||
"Arduino_101_BLE.ino" : { "board": "genuino101" },
|
||||
|
||||
# RBL
|
||||
"RedBear_Duo_WiFi.ino" : { "skip": True },
|
||||
"RedBear_Duo_BLE.ino" : { "skip": True },
|
||||
"RedBearLab_BLE_Nano.ino" : { "skip": True, "board": "redBearLabBLENano", "framework": "arduino" }, # Not for Arduino
|
||||
"RedBearLab_BlendMicro.ino" : { "board": "blendmicro8" },
|
||||
"RedBearLab_BLE_Mini.ino" : { "board": "leonardo" },
|
||||
|
||||
# GSM
|
||||
"SIM800_SIM900.ino" : { "board": "leonardo" },
|
||||
|
||||
#Other
|
||||
"Blue_Pill_STM32F103C.ino" : { "board": "bluepill_f103c8", "framework": "arduino" },
|
||||
"Fishino.ino" : { "skip": True }, # requires extra lib
|
||||
"BBC_MicroBit.ino" : { "board": "uno", "lib_deps": "SPI" }, #TODO
|
||||
"Simblee_BLE.ino" : { "skip": True },
|
||||
"RFDuino_BLE.ino" : { "board": "rfduino" },
|
||||
"DFRobot_Bluno_BLE_Link.ino" : { "board": "leonardo" },
|
||||
"Microduino_BLE.ino" : { "board": "leonardo" },
|
||||
"TinyDuino_WiFi.ino" : { "board": "tinyduino", "lib_deps": "Adafruit CC3000 Library" },
|
||||
"CC3000.ino" : { "board": "uno", "lib_deps": "Adafruit CC3000 Library" },
|
||||
"WildFire_V3.ino" : { "board": "wildfirev3", "lib_deps": "WildFire-CC3000" },
|
||||
"WildFire_V4.ino" : { "skip": True },
|
||||
"chipKIT_Uno32.ino" : { "board": "uno_pic32" },
|
||||
"LightBlue_Bean.ino" : { "board": "lightblue-bean" },
|
||||
"Teensy3.ino" : { "board": "teensy31" },
|
||||
"ATtiny85.ino" : { "board": "attiny85" },
|
||||
"DHT11.ino" : { "board": "uno", "lib_deps": "Adafruit Unified Sensor" },
|
||||
|
||||
# Special examples
|
||||
"ESP8266.ino" : ESP8266,
|
||||
"HandleDisconnect.ino" : ESP8266,
|
||||
|
||||
|
||||
# No linux support
|
||||
"LinkItONE.ino" : { "skip": True },
|
||||
|
||||
# Energia
|
||||
"Energia_WiFi.ino" : { "skip": True, "board": "lpmsp430f5529" },
|
||||
"Energia_BLE.ino" : { "skip": True, "board": "..." },
|
||||
"Energia_Ethernet.ino" : { "board": "lptm4c1294ncpdt" },
|
||||
"Energia_Serial_USB.ino" : { "board": "lplm4f120h5qr" },
|
||||
}
|
||||
|
||||
pio_project_options = ['lib_ignore', 'framework', 'build_flags', 'lib_deps']
|
||||
|
||||
#seeedTinyBLE
|
||||
#nrf51_dk
|
||||
|
||||
#nucleo_f401re
|
||||
#rfduino
|
||||
|
||||
examples = []
|
||||
for root, dirnames, filenames in os.walk('examples'):
|
||||
for filename in fnmatch.filter(filenames, '*.ino'):
|
||||
fn = os.path.join(root, filename)
|
||||
examples.append(fn)
|
||||
|
||||
examples.sort()
|
||||
|
||||
for fn in examples:
|
||||
path, ino = os.path.split(fn)
|
||||
|
||||
if ino in metadata:
|
||||
m = metadata[ino]
|
||||
m['sketch_found'] = True
|
||||
extra_args = ''
|
||||
if 'board' in m:
|
||||
extra_args += "--board=" + m['board'] + " "
|
||||
if set(m.keys()) & set(pio_project_options):
|
||||
for _key in set(m.keys()) & set(pio_project_options):
|
||||
extra_args += "--project-option='{0}={1}' ".format(_key, m[_key])
|
||||
|
||||
if len(extra_args):
|
||||
path += ' PLATFORMIO_CI_EXTRA_ARGS="' + extra_args.strip() + '"'
|
||||
else:
|
||||
m = {}
|
||||
|
||||
if 'skip' in m:
|
||||
path = " # - PLATFORMIO_CI_SRC=" + path
|
||||
else:
|
||||
path = " - PLATFORMIO_CI_SRC=" + path
|
||||
|
||||
print path
|
||||
|
||||
for ino, m in metadata.items():
|
||||
if not 'sketch_found' in m:
|
||||
print "Sketch not found:", ino
|
||||
Reference in New Issue
Block a user