Compare commits

..

2 commits

Author SHA1 Message Date
Martino Facchin
53c45b18fd WIP: export wifi interface statistics
At the moment data is exported in textual format (as a dump) for easy printing on the library side; when complete, the dump must be in machine compact format.
2018-10-24 11:57:11 +02:00
Martino Facchin
50f55a0732 Expose WPA2 enterprise APIs 2018-10-22 14:37:54 +02:00
65 changed files with 4251 additions and 5887 deletions

View file

@ -1,67 +0,0 @@
name: Build
on:
repository_dispatch:
push:
pull_request:
branches: [ master ]
release:
types:
- created
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
IDF_VERSION: v5.5
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board:
- 'esp32'
- 'fruitjam_c6'
build_type:
- 'Release'
- 'Debug'
steps:
- name: Pull ESP-IDF docker
run: docker pull espressif/idf:$IDF_VERSION
- name: Checkout
uses: actions/checkout@v4
- name: Checkout submodules
run: git submodule update --init --depth 1 certificates components/arduino-esp32
- name: Build
run: |
docker run --rm -v $PWD:/project -w /project espressif/idf:$IDF_VERSION /bin/bash -c "git config --global --add safe.directory /project && idf.py -DBOARD=${{ matrix.board }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} build"
# combine.py is auto run as postbuild
if [ "${{ matrix.build_type }}" == "Debug" ]; then
# add debug suffix to the bin file
mv NINA_ADAFRUIT*.bin "$(echo NINA_ADAFRUIT*.bin | sed 's/.bin/_Debug.bin/')"
fi
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
#name: nina-fw-${{ matrix.board }}${{ matrix.build_type == 'Debug' && format('-{0}', matrix.build_type) || '' }}
name: NINA_ADAFRUIT-${{ matrix.board }}-${{ matrix.build_type }}
path: |
NINA_ADAFRUIT*.bin
# - name: Prepare Release Asset
# if: github.event_name == 'release' && matrix.build_type == 'Release'
# run: cp build/nina-fw.bin nina-fw-${{ matrix.board }}-${{ github.event.release.tag_name }}-${{ matrix.build_type }}.bin
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
if: github.event_name == 'release'
with:
files: |
NINA_ADAFRUIT*.bin

7
.gitignore vendored
View file

@ -1,8 +1 @@
build/
*.bin
# Regenerate sdkconfig from the sdkconfig.defaults* files.
sdkconfig.esp32
sdkconfig.esp32c6
sdkconfig.*.old
sdkconfig.old
managed_components/

6
.gitmodules vendored
View file

@ -1,6 +0,0 @@
[submodule "certificates"]
path = certificates
url = https://github.com/adafruit/certificates
[submodule "arduino-esp32"]
path = components/arduino-esp32
url = https://github.com/espressif/arduino-esp32

View file

@ -1,45 +0,0 @@
# .travis.yml for nina-fw
# adapted from https://github.com/igrr/esp32-cam-demo/blob/master/.travis.yml
sudo: false
language: bash
os:
- linux
addons:
apt:
packages:
- python3.5
- gperf
before_install:
# Save path to the git respository
- PROJECT_PATH=$(pwd)
install:
- mkdir -p ~/esp
- cd ~/esp
# Download binary toolchain for the ESP32
- wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
- tar -xzf xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
# Make xtensa-esp32-elf available for all terminal sessions
- export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin
# Get ESP-IDF v3.3.1
- git clone --branch v3.3.1 --recursive https://github.com/espressif/esp-idf.git
# Set the path to ESP-IDF directory
- export IDF_PATH=~/esp/esp-idf
# Install Required Python Packages
- python -m pip install --user -r $IDF_PATH/requirements.txt
script:
- cd $PROJECT_PATH
- make firmware
deploy:
provider: releases
api_key: "$GITHUB_TOKEN"
file_glob: true
file: "NINA_W102-*.bin"
skip_cleanup: true
on:
tags: true

168
CHANGELOG
View file

@ -1,168 +0,0 @@
# Changelog
## Adafruit firmware
Adafruit's Arduino NINA-W102 firmware 1.7.7 - 2023.09.20
* Change to use adafruit/certificates repo for roots.pem
Adafruit's Arduino NINA-W102 firmware 1.7.5 - 2023.07.21
* Fix for bug in NINA-W102 firmware 1.7.5 not allowing uploads on Windows/Linux
Adafruit's Arduino NINA-W102 firmware 1.7.5 - 2023.07.21
* Fixed Adafruit IO Root SSL Certificate
Adafruit's Arduino NINA-W102 firmware 1.7.4 - 2021.06.03
* Fixed support for custom hostname in WiFi client mode
Adafruit's Arduino NINA-W102 firmware 1.7.3 - 2021.03.26
* Changed Analog Write to use full PWM range.
* Added support to Pin Mode for INPUT_PULLUP.
Adafruit's Arduino NINA-W102 firmware 1.7.2 - 2021.03.05
* Replace peek() with available() during connection status check to avoid losing messages.
Adafruit's Arduino NINA-W102 firmware 1.7.1 - 2020.10.24
* Enable HCI BLE for AirLift boards and breakouts.
Adafruit's Arduino NINA-W102 firmware 1.6.0 - 2019.12.28
* Updated to build with ESP-IDF 3.3.1
Adafruit's Arduino NINA-W102 firmware 1.5.0 - 2019.10.21
* Added Digital Read and Analog Read
Adafruit's Arduino NINA-W102 firmware 1.4.0 - 2019.10.09
* Updated to use ESP-IDF 3.3 (LTS)
* Updated WiFiSSLClient
* Workflow improvements in Makefile
Adafruit's Arduino NINA-W102 firmware 1.3.1 - 2019.04.24
* Added WPA2 Enterprise
* Updated README.md to indicate this is Adafruit's fork
* Updated README.md with current, reproducible build instructions
* Updated CHANGELOG with various Adafruit changes
Adafruit's Arduino NINA-W102 firmware 1.3.0 - 2019.04.04
* Rev'd version in CommandHandler.cpp
* Added version number to combine.py script
Adafruit's Arduino NINA-W102 firmware 1.2.2 - 2019.04.04
* Added support for WPA2 Enterprise
Adafruit's Arduino NINA-W102 firmware 1.2.2 - 2019.02.28
* First official Adafruit release
## Arduino firmware
Arduino NINA-W102 firmware 1.5.0 - 2022.07.09
* Add BSD-like sockets APIs (on command range 0x70 -> 0x7f)
* Fix ADC readings range (fuill scale range is now ~2.7V)
Arduino NINA-W102 firmware 1.4.8 - 2021.07.29
* Fix issue due to repeated status()/connected() call (#73)
Arduino NINA-W102 firmware 1.4.7 - 2021.06.18
Functionally identical with 1.4.6, except version number.
This release was made necessary because bad arguments were used with the FirmwareUploader tool
on Arduino Cloud for updating NINA-FWs (effectively deleting all certificates except the one
fetched by the tool). Now all Cloud-Connected NINA-FWs need to be updated once more which is
only possible by incrementing the firmware version number.
Arduino NINA-W102 firmware 1.4.6 - 2021.06.09
* Add a new root certificate list including detailed instructions how to update it (#71)
Arduino NINA-W102 firmware 1.4.5 - 2021.05.05
* Adding support for Arduino RP2040 Nano Connect (#67)
* Added ISRG Root X1 for LetsEncrypt (#68)
Arduino NINA-W102 firmware 1.4.4 - 2021.04.13
* Adding support for Arduino RP2040 Nano Connect (#64)
Arduino NINA-W102 firmware 1.4.3 - 2021.01.29
* Do not immediately close connection after 1 failed write (#62)
Arduino NINA-W102 firmware 1.4.2 - 2021.01.28
Port BearSSL + crypto integration to NINA (#57). This allows to offload BearSSL for Arduino IoT Cloud applications to the nina module, drastically saving on flash/RAM.
Arduino NINA-W102 firmware 1.4.1 - 2020.08.17
* Direct download of OTA binary to Nina storage and verifying both CRC and length (#53)
Arduino NINA-W102 firmware 1.4.0 - 2020.07.13
* Adding API which allows to utilize the nina file system as an external storage module for the host CPU (#32)
* Fixing bug leading to packet corruption in situation of high UDP traffic (#49)
* Fixing bug leading to missing packets and connection drop (#50)
Arduino NINA-W102 firmware 1.3.0 - 2019.12.23
* Fixed channel's assignement for WiFi.beginAP(...)
* Fixed set host name API begin connecting to AP
* Updated to IDF v3.3.1
* Added WPA2 Enterprise support (PEAP/MSCHAPv2 + EAP-TLS)
Arduino NINA-W102 firmware 1.2.4 - 2019.06.14
* Disabled CONFIG_LWIP_DHCP_DOES_ARP_CHECK
* Added small delay to WiFiUDP.parsePacket() allow other tasks to run
* Updated to esp-idf v3.3 branch
Arduino NINA-W102 firmware 1.2.3 - 2018.04.09
* Added reason code command to retrieve the disconnect reason code
* WiFiSSLClient: enable SNI via mbedtls_ssl_set_hostname when using hostname
Arduino NINA-W102 firmware 1.2.2 - 2018.03.26
* Changed connections to use WIFI_FAST_SCAN instead of WIFI_ALL_CHANNEL_SCAN
* Changed ASSOC_FAIL error handling, to now try to re-connect
* Added phy_init partition with u-blox recommended phy init data and use
* Fixed socket connections hanging when WiFi is disconnected
* Fixed issues where DNS server could be reset to 0.0.0.0 on WiFi re-connections
* Updated to use esp-idf 3.1.3
Arduino NINA-W102 firmware 1.2.1 - 2018.11.16
* Fixed factory SSL certificates being incorrectly parsed due to OOM caused by Bluetooth inclusion
Arduino NINA-W102 firmware 1.2.0 - 2018.11.13
* Fixed DNS servers not sticking when static IP address is used
* Added HCI UART mode on boot, enabled if SS is LOW
* Erase NVS flash on init failure
Arduino NINA-W102 firmware 1.1.0 - 2018.10.4
* WiFi is now stopped before connecting to AP
* Changed default STA hostname to "arduino-XXYY"
* Switched to all channel scan when connecting to AP in STA mode
* Fixed static IP's support in STA + AP modes
* Return failure on bad AP params
* Moved certificates to separate mmapped partition, added a larger set of built-in root CA's
* Updated to use esp-idf v3.1
Arduino NINA-W102 firmware 1.0.0 - 2018.06.28
* Initial release

View file

@ -1,41 +0,0 @@
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
if (BOARD STREQUAL "fruitjam_c6")
set(IDF_TARGET esp32c6 CACHE STRING "Target ESP-IDF board")
elseif (BOARD STREQUAL "esp32")
set(IDF_TARGET esp32 CACHE STRING "Target ESP-IDF board")
else ()
message(FATAL_ERROR "Unsupported BOARD: ${BOARD}. Supported boards are: fruitjam_c6, esp32")
endif ()
set(SDKCONFIG ${CMAKE_BINARY_DIR}/sdkconfig)
set(SDKCONFIG_DEFAULTS sdkconfig.defaults ${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/sdkconfig)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
list(APPEND SDKCONFIG_DEFAULTS sdkconfig.debug)
endif ()
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(CMAKE_BUILD_TYPE_DEBUG)
endif ()
STRING(TOUPPER ${BOARD} BOARD_UPPER)
add_compile_definitions(
BOARD_${BOARD_UPPER}
)
set(EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_LIST_DIR}/boards)
# required when upgrading to esp-idf v5.5 and arduino-esp32 v3.3.0
add_link_options("-Wl,-u,__wrap_esp_log_writev")
project(nina-fw)
# Post build to run combine.py
add_custom_command(TARGET app POST_BUILD
COMMAND python ${CMAKE_CURRENT_LIST_DIR}/combine.py -b ${CMAKE_BINARY_DIR} NINA_ADAFRUIT-${BOARD}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
VERBATIM
)

View file

@ -1,57 +1,15 @@
PROJECT_NAME := nina-fw
# Passthrough Board Port
M4_PORT := /dev/cu.usbmodem14121301
UPLOAD_BAUD = 115200
# ESP32 USB Serial Port
ESP_PORT := /dev/cu.usbserial-AH03B302
# Directories and Files
BOOT_VOLUME := /Volumes/FEATHERBOOT/.
CIRCUITPYTHON_UF2 := circuitpython.uf2
EXTRA_COMPONENT_DIRS := $(PWD)/arduino
CPPFLAGS += -DARDUINO
ifeq ($(RELEASE),1)
CFLAGS += -DNDEBUG -DCONFIG_FREERTOS_ASSERT_DISABLE -Os -DLOG_LOCAL_LEVEL=0
CPPFLAGS += -DNDEBUG -Os
endif
ifeq ($(UNO_WIFI_REV2),1)
CFLAGS += -DUNO_WIFI_REV2
CPPFLAGS += -DUNO_WIFI_REV2
endif
ifeq ($(NANO_RP2040_CONNECT),1)
CFLAGS += -DNANO_RP2040_CONNECT
CPPFLAGS += -DNANO_RP2040_CONNECT
endif
include $(IDF_PATH)/make/project.mk
load-passthrough:
cp passthrough.UF2 $(BOOT_VOLUME)
load-nina:
esptool.py --port $(M4_PORT) --before no_reset --baud $(UPLOAD_BAUD) write_flash 0 $(wildcard NINA_W102-*.bin)
load-circuitpython:
cp $(CIRCUITPYTHON_UF2) $(BOOT_VOLUME)
serial:
miniterm.py $(ESP_PORT) $(UPLOAD_BAUD)
firmware: all
python combine.py
.PHONY: firmware
.PHONY: load-passthrough
.PHONY: load-nina
.PHONY: load-circuitpython
.PHONY: serial

View file

@ -1,69 +1,20 @@
# Adafruit fork of the Arduino NINA-W102 firmware
[![Build Status](https://travis-ci.com/adafruit/nina-fw.svg?branch=master)](https://travis-ci.com/adafruit/nina-fw)
This is the Adafruit fork of the Arduino NINA-W102 firmware. The original
repository is located at https://github.com/arduino/nina-fw
# Arduino NINA-W102 firmware
This firmware uses [Espressif's IDF](https://github.com/espressif/esp-idf)
## Contributing to nina-fw
Please be aware that by contributing to this project
you are agreeing to the [Code of Conduct](https://github.com/adafruit/nina-fw/blob/master/code-of-conduct.md).
Contributors who follow the [Code of Conduct](https://github.com/adafruit/nina-fw/blob/master/code-of-conduct.md)
are welcome to submit pull requests and they will be promptly
reviewed by project admins. Please join the [Discord](https://adafru.it/discord) too.
The NINA firmware version needs to be updated in two places in this repo:
1. CommandHandler.cpp
1. CHANGELOG
## Building
The firmware shipped in Adafruit's products is compiled following these
instructions. These may differ from the instructions included in the
original Arduino firmware repository.
1. [Download the ESP32 toolchain](https://docs.espressif.com/projects/esp-idf/en/v3.3.1/get-started/index.html#setup-toolchain)
1. [Download the ESP32 toolchain](http://esp-idf.readthedocs.io/en/v3.1/get-started/index.html#setup-toolchain)
1. Extract it and add it to your `PATH`: `export PATH=$PATH:<path/to/toolchain>/bin`
1. Clone **v5.5** of the IDF: `git clone --branch v5.5 --recursive https://github.com/espressif/esp-idf.git`
1. Clone **v3.1** of the IDF: `git clone --branch v3.1 --recursive https://github.com/espressif/esp-idf.git`
1. Set the `IDF_PATH` environment variable: `export IDF_PATH=<path/to/idf>`
1. `git submodule update --init` to fetch the `certificates` submodule.
1. Run `make firmware` to build the firmware (in the directory of this read me)
1. You may need to set up a python3 `venv` to avoid Python library version issues.
1. You should have a file named `NINA_W102-x.x.x.bin` in the top directory
1. Use appropriate tools (`esptool.py`, appropriate pass-through firmware etc)
to load this binary file onto your board.
a. If you do not know how to do this, [we have an excellent guide on the Adafruit Learning System for upgrading your ESP32's firmware](https://learn.adafruit.com/upgrading-esp32-firmware)
## Packaging
The `make` command produces a bunch of binary files that must be flashed at very precise locations, making `esptool` commandline quite complicated.
Instead, once the firmware has been compiled, you can invoke `combine.py` script to produce a monolithic binary that can be flashed at 0x0.
```
make
python combine.py
```
This produces `NINA_W102.bin-{version}` file (a different name can be specified as parameter). To flash this file you can use https://learn.adafruit.com/upgrading-esp32-firmware
## Build a new certificate list (based on the Google Android root CA list)
```bash
git clone https://android.googlesource.com/platform/system/ca-certificates
cp nina-fw/tools/nina-fw-create-roots.sh ca-certificates/files
cd ca-certificates/files
./nina-fw-create-roots.sh
cp roots.pem ../../nina-fw/data/roots.pem
```
## Check certificate list against URL list
```bash
cd tools
./sslcheck.sh -c ../data/roots.pem -l url_lists/url_list_moz.com.txt -e
```
1. Run `make` to build the firmware (in the directory of this read me)
1. Load the `Tools -> SerialNINAPassthrough` example sketch on to the board
1. Use `esptool` to flash the compiled firmware
## License
Copyright (c) 2018-2019 Arduino SA. All rights reserved.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

3
arduino/component.mk Normal file
View file

@ -0,0 +1,3 @@
COMPONENT_ADD_INCLUDEDIRS := cores/esp32 libraries/SPIS/src libraries/WiFi/src
COMPONENT_SRCDIRS := cores/esp32 libraries/SPIS/src libraries/WiFi/src

View file

@ -0,0 +1,52 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ARDUINO_H
#define ARDUINO_H
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#ifdef __cplusplus
extern "C"{
#endif // __cplusplus
// system functions
void init(void);
// sketch
void setup(void);
void loop(void);
#ifdef __cplusplus
} // extern "C"
#endif
#ifdef __cplusplus
#include "WMath.h"
#endif
#include "delay.h"
#include "wiring_digital.h"
#include "wiring_analog.h"
#endif // ARDUINO_H

View file

@ -0,0 +1,74 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <driver/gpio.h>
#include "wiring_digital.h"
#include "WInterrupts.h"
static voidFuncPtr callbacksInt[GPIO_NUM_MAX] = { NULL };
void IRAM_ATTR gpioInterruptHandler(void* arg)
{
uint32_t pin = (uint32_t)arg;
if (callbacksInt[pin]) {
callbacksInt[pin]();
}
}
void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode)
{
callbacksInt[pin] = callback;
switch (mode) {
case LOW:
gpio_set_intr_type((gpio_num_t)pin, GPIO_INTR_LOW_LEVEL);
gpio_wakeup_enable((gpio_num_t)pin, GPIO_INTR_LOW_LEVEL);
break;
case HIGH:
gpio_set_intr_type((gpio_num_t)pin, GPIO_INTR_HIGH_LEVEL);
gpio_wakeup_enable((gpio_num_t)pin, GPIO_INTR_HIGH_LEVEL);
break;
case CHANGE:
gpio_set_intr_type((gpio_num_t)pin, GPIO_INTR_ANYEDGE);
break;
case FALLING:
gpio_set_intr_type((gpio_num_t)pin, GPIO_INTR_NEGEDGE);
break;
case RISING:
gpio_set_intr_type((gpio_num_t)pin, GPIO_INTR_POSEDGE);
break;
default:
gpio_set_intr_type((gpio_num_t)pin, GPIO_INTR_DISABLE);
break;
}
gpio_install_isr_service(ESP_INTR_FLAG_LEVEL3);
gpio_isr_handler_add((gpio_num_t)pin, gpioInterruptHandler, (void*)pin);
gpio_intr_enable((gpio_num_t)pin);
}

View file

@ -0,0 +1,43 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _WIRING_INTERRUPTS_
#define _WIRING_INTERRUPTS_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
// #define LOW 0
// #define HIGH 1
#define CHANGE 2
#define FALLING 3
#define RISING 4
typedef void (*voidFuncPtr)(void);
void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,33 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
extern "C" {
#include <esp_system.h>
}
#include "WMath.h"
extern long random(long howbig)
{
if(howbig == 0) {
return 0;
}
return esp_random() % howbig;
}

View file

@ -0,0 +1,33 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _WIRING_MATH_
#define _WIRING_MATH_
#ifdef __cplusplus
extern "C" {
#endif
extern long random(long);
#ifdef __cplusplus
}
#endif
#endif /* _WIRING_MATH_ */

View file

@ -0,0 +1,33 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include "delay.h"
unsigned long millis()
{
return xTaskGetTickCount() * portTICK_PERIOD_MS;
}
void delay(uint32_t ms)
{
vTaskDelay(ms / portTICK_PERIOD_MS);
}

View file

@ -0,0 +1,37 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef DELAY_H
#define DELAY_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
extern unsigned long millis();
extern void delay(uint32_t ms);
#ifdef __cplusplus
}
#endif
#endif // DELAY_H

View file

@ -0,0 +1,40 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#define ARDUINO_MAIN
#include "Arduino.h"
void arduino_main(void*) {
init();
setup();
while (1) {
loop();
}
}
extern "C" {
void app_main() {
xTaskCreatePinnedToCore(arduino_main, "arduino", 8192, NULL, 1, NULL, 1);
}
}

View file

@ -0,0 +1,26 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <nvs_flash.h>
#include "Arduino.h"
void init() {
nvs_flash_init();
}

View file

@ -0,0 +1,45 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <driver/ledc.h>
#include "wiring_analog.h"
void analogWrite(uint32_t pin, uint32_t value)
{
periph_module_enable(PERIPH_LEDC_MODULE);
ledc_timer_config_t timerConf = {
.bit_num = LEDC_TIMER_10_BIT,
.freq_hz = 1000,
.speed_mode = LEDC_HIGH_SPEED_MODE,
.timer_num = (pin / 7),
};
ledc_timer_config(&timerConf);
ledc_channel_config_t ledc_conf = {
.channel = (pin % 7),
.duty = (value << 2),
.gpio_num = pin,
.intr_type = LEDC_INTR_DISABLE,
.speed_mode = LEDC_HIGH_SPEED_MODE,
.timer_sel = (pin / 7)
};
ledc_channel_config(&ledc_conf);
}

View file

@ -0,0 +1,35 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WIRING_ANALOG_H
#define WIRING_ANALOG_H
#include "Arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void analogWrite(uint32_t pin, uint32_t value);
#ifdef __cplusplus
}
#endif
#endif // WIRING_ANALOG_H

View file

@ -0,0 +1,44 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <driver/gpio.h>
#include "wiring_digital.h"
void pinMode(uint32_t pin, uint32_t mode)
{
switch (mode) {
case INPUT:
gpio_set_direction((gpio_num_t)pin, GPIO_MODE_INPUT);
gpio_set_pull_mode((gpio_num_t)pin, GPIO_FLOATING);
break;
case OUTPUT:
gpio_set_direction((gpio_num_t)pin, GPIO_MODE_OUTPUT);
gpio_set_pull_mode((gpio_num_t)pin, GPIO_FLOATING);
break;
}
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[pin], PIN_FUNC_GPIO);
}
void digitalWrite(uint32_t pin, uint32_t val)
{
gpio_set_level((gpio_num_t)pin, val);
}

View file

@ -0,0 +1,43 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WIRING_DIGITAL_H
#define WIRING_DIGITAL_H
#include "Arduino.h"
#ifdef __cplusplus
extern "C" {
#endif
#define LOW 0x00
#define HIGH 0x01
#define INPUT 0x00
#define OUTPUT 0x01
extern void pinMode(uint32_t pin, uint32_t mode);
extern void digitalWrite(uint32_t pin, uint32_t val);
#ifdef __cplusplus
}
#endif
#endif // WIRING_DIGITAL_H

View file

@ -22,7 +22,8 @@
#include <driver/gpio.h>
#include <driver/spi_slave.h>
#include "esp32-hal-gpio.h"
#include "wiring_digital.h"
#include "WInterrupts.h"
#include "SPIS.h"
@ -112,5 +113,4 @@ void SPISClass::handleSetupComplete()
xSemaphoreGiveFromISR(_readySemaphore, NULL);
}
// Move definition to sketch.ino.cpp
// SPISClass SPIS(VSPI_HOST, 1, 12, 23, 18, 5, 33);
SPISClass SPIS(VSPI_HOST, 1, 12, 23, 18, 5, 33);

View file

@ -0,0 +1,710 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <time.h>
#include <esp_wifi.h>
#include <tcpip_adapter.h>
#include <apps/sntp/sntp.h>
#include <lwip/dns.h>
#include <lwip/netdb.h>
#include <lwip/raw.h>
#include <lwip/icmp.h>
#include <lwip/sockets.h>
#include <lwip/ip_addr.h>
#include <lwip/inet_chksum.h>
#include "WiFi.h"
WiFiClass::WiFiClass() :
_initialized(false),
_status(WL_NO_SHIELD),
_interface(ESP_IF_WIFI_STA),
_onReceiveCallback(NULL)
{
_eventGroup = xEventGroupCreate();
memset(&_apRecord, 0x00, sizeof(_apRecord));
memset(&_ipInfo, 0x00, sizeof(_ipInfo));
}
uint8_t WiFiClass::status()
{
if (!_initialized) {
_initialized = true;
init();
}
return _status;
}
int WiFiClass::hostByName(const char* hostname, /*IPAddress*/uint32_t& result)
{
result = 0xffffffff;
struct hostent* hostEntry = lwip_gethostbyname(hostname);
if (hostEntry == NULL) {
return 0;
}
memcpy(&result, hostEntry->h_addr_list[0], sizeof(result));
return 1;
}
int WiFiClass::ping(/*IPAddress*/uint32_t host, uint8_t ttl)
{
uint32_t timeout = 5000;
int s = socket(AF_INET, SOCK_RAW, IP_PROTO_ICMP);
struct timeval timeoutVal;
timeoutVal.tv_sec = (timeout / 1000);
timeoutVal.tv_usec = (timeout % 1000) * 1000;
setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &timeoutVal, sizeof(timeoutVal));
setsockopt(s, IPPROTO_IP, IP_TTL, &ttl, sizeof(ttl));
struct __attribute__((__packed__)) {
struct icmp_echo_hdr header;
uint8_t data[32];
} request;
ICMPH_TYPE_SET(&request.header, ICMP_ECHO);
ICMPH_CODE_SET(&request.header, 0);
request.header.chksum = 0;
request.header.id = 0xAFAF;
request.header.seqno = random(0xffff);
for (size_t i = 0; i < sizeof(request.data); i++) {
request.data[i] = i;
}
request.header.chksum = inet_chksum(&request, sizeof(request));
ip_addr_t addr;
addr.type = IPADDR_TYPE_V4;
addr.u_addr.ip4.addr = host;
// IP_ADDR4(&addr, ip[0], ip[1], ip[2], ip[3]);
struct sockaddr_in to;
struct sockaddr_in from;
to.sin_len = sizeof(to);
to.sin_family = AF_INET;
inet_addr_from_ipaddr(&to.sin_addr, ip_2_ip4(&addr));
sendto(s, &request, sizeof(request), 0, (struct sockaddr*)&to, sizeof(to));
unsigned long sendTime = millis();
unsigned long recvTime = 0;
do {
socklen_t fromlen = sizeof(from);
struct __attribute__((__packed__)) {
struct ip_hdr ipHeader;
struct icmp_echo_hdr header;
} response;
int rxSize = recvfrom(s, &response, sizeof(response), 0, (struct sockaddr*)&from, (socklen_t*)&fromlen);
if (rxSize == -1) {
// time out
break;
}
if (rxSize < sizeof(response)) {
// too short
continue;
}
if (from.sin_family != AF_INET) {
// not IPv4
continue;
}
if ((response.header.id == request.header.id) && (response.header.seqno == request.header.seqno)) {
recvTime = millis();
}
} while (recvTime == 0);
close(s);
if (recvTime == 0) {
return -1;
} else {
return (recvTime - sendTime);
}
}
uint8_t WiFiClass::begin(const char* ssid)
{
return begin(ssid, "");
}
uint8_t WiFiClass::begin(const char* ssid, uint8_t key_idx, const char* key)
{
return begin(ssid, key);
}
uint8_t WiFiClass::begin(const char* ssid, const char* key)
{
wifi_config_t wifiConfig;
memset(&wifiConfig, 0x00, sizeof(wifiConfig));
strncpy((char*)wifiConfig.sta.ssid, ssid, sizeof(wifiConfig.sta.ssid));
strncpy((char*)wifiConfig.sta.password, key, sizeof(wifiConfig.sta.password));
wifiConfig.sta.scan_method = WIFI_ALL_CHANNEL_SCAN;
_status = WL_NO_SSID_AVAIL;
_interface = ESP_IF_WIFI_STA;
esp_wifi_stop();
esp_wifi_set_mode(WIFI_MODE_STA);
esp_wifi_start();
xEventGroupWaitBits(_eventGroup, BIT0, false, true, portMAX_DELAY);
if (esp_wifi_set_config(ESP_IF_WIFI_STA, &wifiConfig) != ESP_OK) {
_status = WL_CONNECT_FAILED;
}
if (_ipInfo.ip.addr) {
tcpip_adapter_dhcpc_stop(TCPIP_ADAPTER_IF_STA);
tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_STA, &_ipInfo);
} else {
tcpip_adapter_dhcpc_start(TCPIP_ADAPTER_IF_STA);
}
esp_wifi_connect();
return _status;
}
uint8_t WiFiClass::beginAP(const char *ssid, uint8_t channel)
{
wifi_config_t wifiConfig;
memset(&wifiConfig, 0x00, sizeof(wifiConfig));
strncpy((char*)wifiConfig.ap.ssid, ssid, sizeof(wifiConfig.sta.ssid));
wifiConfig.ap.channel = 0;
wifiConfig.ap.authmode = WIFI_AUTH_OPEN;
wifiConfig.ap.max_connection = 4;
_status = WL_NO_SSID_AVAIL;
_interface = ESP_IF_WIFI_AP;
esp_wifi_stop();
esp_wifi_set_mode(WIFI_MODE_AP);
if (esp_wifi_set_config(ESP_IF_WIFI_AP, &wifiConfig) != ESP_OK) {
_status = WL_AP_FAILED;
} else {
esp_wifi_start();
xEventGroupWaitBits(_eventGroup, BIT1, false, true, portMAX_DELAY);
}
return _status;
}
uint8_t WiFiClass::beginAP(const char *ssid, uint8_t key_idx, const char* key, uint8_t channel)
{
wifi_config_t wifiConfig;
memset(&wifiConfig, 0x00, sizeof(wifiConfig));
strncpy((char*)wifiConfig.ap.ssid, ssid, sizeof(wifiConfig.sta.ssid));
strncpy((char*)wifiConfig.ap.password, key, sizeof(wifiConfig.sta.password));
wifiConfig.ap.channel = 0;
wifiConfig.ap.authmode = WIFI_AUTH_WEP;
wifiConfig.ap.max_connection = 4;
_status = WL_NO_SSID_AVAIL;
_interface = ESP_IF_WIFI_AP;
esp_wifi_stop();
esp_wifi_set_mode(WIFI_MODE_AP);
if (esp_wifi_set_config(ESP_IF_WIFI_AP, &wifiConfig) != ESP_OK) {
_status = WL_AP_FAILED;
} else {
esp_wifi_start();
xEventGroupWaitBits(_eventGroup, BIT1, false, true, portMAX_DELAY);
}
return _status;
}
uint8_t WiFiClass::beginAP(const char *ssid, const char* key, uint8_t channel)
{
wifi_config_t wifiConfig;
memset(&wifiConfig, 0x00, sizeof(wifiConfig));
strncpy((char*)wifiConfig.ap.ssid, ssid, sizeof(wifiConfig.sta.ssid));
strncpy((char*)wifiConfig.ap.password, key, sizeof(wifiConfig.sta.password));
wifiConfig.ap.channel = 0;
wifiConfig.ap.authmode = WIFI_AUTH_WPA_WPA2_PSK;
wifiConfig.ap.max_connection = 4;
_status = WL_NO_SSID_AVAIL;
_interface = ESP_IF_WIFI_AP;
esp_wifi_stop();
esp_wifi_set_mode(WIFI_MODE_AP);
if (esp_wifi_set_config(ESP_IF_WIFI_AP, &wifiConfig) != ESP_OK) {
_status = WL_AP_FAILED;
} else {
esp_wifi_start();
xEventGroupWaitBits(_eventGroup, BIT1, false, true, portMAX_DELAY);
}
return _status;
}
void WiFiClass::config(/*IPAddress*/uint32_t local_ip, /*IPAddress*/uint32_t gateway, /*IPAddress*/uint32_t subnet)
{
dns_clear_servers(true);
_ipInfo.ip.addr = local_ip;
_ipInfo.gw.addr = gateway;
_ipInfo.netmask.addr = subnet;
if (_interface == ESP_IF_WIFI_AP) {
tcpip_adapter_dhcps_stop(TCPIP_ADAPTER_IF_AP);
tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_AP, &_ipInfo);
tcpip_adapter_dhcps_start(TCPIP_ADAPTER_IF_AP);
} else {
tcpip_adapter_dhcpc_stop(TCPIP_ADAPTER_IF_STA);
tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_STA, &_ipInfo);
}
}
void WiFiClass::setDNS(/*IPAddress*/uint32_t dns_server1, /*IPAddress*/uint32_t dns_server2)
{
ip_addr_t d;
d.type = IPADDR_TYPE_V4;
if (dns_server1) {
d.u_addr.ip4.addr = static_cast<uint32_t>(dns_server1);
dns_setserver(0, &d);
}
if (dns_server2) {
d.u_addr.ip4.addr = static_cast<uint32_t>(dns_server2);
dns_setserver(1, &d);
}
}
void WiFiClass::hostname(const char* name)
{
tcpip_adapter_set_hostname(_interface == ESP_IF_WIFI_AP ? TCPIP_ADAPTER_IF_AP : TCPIP_ADAPTER_IF_STA, name);
}
void WiFiClass::disconnect()
{
esp_wifi_disconnect();
esp_wifi_stop();
}
void WiFiClass::end()
{
esp_wifi_stop();
}
uint8_t* WiFiClass::macAddress(uint8_t* mac)
{
uint8_t macTemp[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
esp_wifi_get_mac(_interface, macTemp);
mac[0] = macTemp[5];
mac[1] = macTemp[4];
mac[2] = macTemp[3];
mac[3] = macTemp[2];
mac[4] = macTemp[1];
mac[5] = macTemp[0];
return mac;
}
uint32_t WiFiClass::localIP()
{
return _ipInfo.ip.addr;
}
uint32_t WiFiClass::subnetMask()
{
return _ipInfo.netmask.addr;
}
uint32_t WiFiClass::gatewayIP()
{
return _ipInfo.gw.addr;
}
char* WiFiClass::SSID()
{
return (char*)_apRecord.ssid;
}
int32_t WiFiClass::RSSI()
{
if (_interface == ESP_IF_WIFI_AP) {
return 0;
} else {
esp_wifi_sta_get_ap_info(&_apRecord);
return _apRecord.rssi;
}
}
uint8_t WiFiClass::encryptionType()
{
uint8_t encryptionType = _apRecord.authmode;
if (encryptionType == WIFI_AUTH_OPEN) {
encryptionType = 7;
} else if (encryptionType == WIFI_AUTH_WEP) {
encryptionType = 5;
} else if (encryptionType == WIFI_AUTH_WPA_PSK) {
encryptionType = 2;
} else if (encryptionType == WIFI_AUTH_WPA2_PSK || encryptionType == WIFI_AUTH_WPA_WPA2_PSK) {
encryptionType = 4;
} else {
// unknown?
encryptionType = 255;
}
return encryptionType;
}
uint8_t* WiFiClass::BSSID(uint8_t* bssid)
{
if (_interface == ESP_IF_WIFI_AP) {
return macAddress(bssid);
} else {
bssid[0] = _apRecord.bssid[5];
bssid[1] = _apRecord.bssid[4];
bssid[2] = _apRecord.bssid[3];
bssid[3] = _apRecord.bssid[2];
bssid[4] = _apRecord.bssid[1];
bssid[5] = _apRecord.bssid[0];
return bssid;
}
}
int8_t WiFiClass::scanNetworks()
{
esp_wifi_set_mode(WIFI_MODE_STA);
esp_wifi_start();
xEventGroupWaitBits(_eventGroup, BIT0, false, true, portMAX_DELAY);
wifi_scan_config_t config;
config.ssid = 0;
config.bssid = 0;
config.channel = 0;
config.show_hidden = false;
config.scan_type = WIFI_SCAN_TYPE_ACTIVE;
config.scan_time.active.min = 100;
config.scan_time.active.max = 300;
xEventGroupClearBits(_eventGroup, BIT2);
if (esp_wifi_scan_start(&config, false) != ESP_OK) {
_status = WL_NO_SSID_AVAIL;
return 0;
}
xEventGroupWaitBits(_eventGroup, BIT2, false, true, portMAX_DELAY);
uint16_t numNetworks;
esp_wifi_scan_get_ap_num(&numNetworks);
if (numNetworks > MAX_SCAN_RESULTS) {
numNetworks = MAX_SCAN_RESULTS;
}
esp_wifi_scan_get_ap_records(&numNetworks, _scanResults);
_status = WL_SCAN_COMPLETED;
return numNetworks;
}
char* WiFiClass::SSID(uint8_t pos)
{
return (char*)_scanResults[pos].ssid;
}
int32_t WiFiClass::RSSI(uint8_t pos)
{
return _scanResults[pos].rssi;
}
uint8_t WiFiClass::encryptionType(uint8_t pos)
{
uint8_t encryptionType = _scanResults[pos].authmode;
if (encryptionType == WIFI_AUTH_OPEN) {
encryptionType = 7;
} else if (encryptionType == WIFI_AUTH_WEP) {
encryptionType = 5;
} else if (encryptionType == WIFI_AUTH_WPA_PSK) {
encryptionType = 2;
} else if (encryptionType == WIFI_AUTH_WPA2_PSK || encryptionType == WIFI_AUTH_WPA_WPA2_PSK) {
encryptionType = 4;
} else {
// unknown?
encryptionType = 255;
}
return encryptionType;
}
uint8_t* WiFiClass::BSSID(uint8_t pos, uint8_t* bssid)
{
const uint8_t* tempBssid = _scanResults[pos].bssid;
bssid[0] = tempBssid[5];
bssid[1] = tempBssid[4];
bssid[2] = tempBssid[3];
bssid[3] = tempBssid[2];
bssid[4] = tempBssid[1];
bssid[5] = tempBssid[0];
return bssid;
}
uint8_t WiFiClass::channel(uint8_t pos)
{
return _scanResults[pos].primary;
}
unsigned long WiFiClass::getTime()
{
time_t now;
time(&now);
if (now < 946684800) {
return 0;
}
return now;
}
void WiFiClass::lowPowerMode()
{
esp_wifi_set_ps(WIFI_PS_MODEM);
}
void WiFiClass::noLowPowerMode()
{
esp_wifi_set_ps(WIFI_PS_NONE);
}
void WiFiClass::onReceive(void(*callback)(void))
{
_onReceiveCallback = callback;
}
err_t WiFiClass::staNetifInputHandler(struct pbuf* p, struct netif* inp)
{
return WiFi.handleStaNetifInput(p, inp);
}
err_t WiFiClass::apNetifInputHandler(struct pbuf* p, struct netif* inp)
{
return WiFi.handleApNetifInput(p, inp);
}
err_t WiFiClass::handleStaNetifInput(struct pbuf* p, struct netif* inp)
{
err_t result = _staNetifInput(p, inp);
if (_onReceiveCallback) {
_onReceiveCallback();
}
return result;
}
err_t WiFiClass::handleApNetifInput(struct pbuf* p, struct netif* inp)
{
err_t result = _apNetifInput(p, inp);
if (_onReceiveCallback) {
_onReceiveCallback();
}
return result;
}
void WiFiClass::init()
{
tcpip_adapter_init();
esp_event_loop_init(WiFiClass::systemEventHandler, this);
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
esp_wifi_init(&cfg);
esp_wifi_set_storage(WIFI_STORAGE_RAM);
sntp_setoperatingmode(SNTP_OPMODE_POLL);
sntp_setservername(0, (char*)"0.pool.ntp.org");
sntp_setservername(1, (char*)"1.pool.ntp.org");
sntp_setservername(2, (char*)"2.pool.ntp.org");
sntp_init();
_status = WL_IDLE_STATUS;
}
esp_err_t WiFiClass::systemEventHandler(void* ctx, system_event_t* event)
{
((WiFiClass*)ctx)->handleSystemEvent(event);
return ESP_OK;
}
void WiFiClass::handleSystemEvent(system_event_t* event)
{
switch (event->event_id) {
case SYSTEM_EVENT_SCAN_DONE:
xEventGroupSetBits(_eventGroup, BIT2);
break;
case SYSTEM_EVENT_STA_START: {
struct netif* staNetif;
uint8_t mac[6];
char defaultHostname[13];
esp_wifi_get_mac(ESP_IF_WIFI_STA, mac);
sprintf(defaultHostname, "arduino-%.2x%.2x", mac[4], mac[5]);
tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_STA, defaultHostname);
if (tcpip_adapter_get_netif(TCPIP_ADAPTER_IF_STA, (void**)&staNetif) == ESP_OK) {
if (staNetif->input != WiFiClass::staNetifInputHandler) {
_staNetifInput = staNetif->input;
staNetif->input = WiFiClass::staNetifInputHandler;
}
}
xEventGroupSetBits(_eventGroup, BIT0);
break;
}
case SYSTEM_EVENT_STA_STOP:
xEventGroupClearBits(_eventGroup, BIT0);
break;
case SYSTEM_EVENT_STA_CONNECTED:
esp_wifi_sta_get_ap_info(&_apRecord);
if (_ipInfo.ip.addr) {
// static IP
_status = WL_CONNECTED;
}
break;
case SYSTEM_EVENT_STA_GOT_IP:
memcpy(&_ipInfo, &event->event_info.got_ip.ip_info, sizeof(_ipInfo));
_status = WL_CONNECTED;
break;
case SYSTEM_EVENT_STA_DISCONNECTED: {
uint8_t reason = event->event_info.disconnected.reason;
memset(&_apRecord, 0x00, sizeof(_apRecord));
if (reason == 201/*NO_AP_FOUND*/ || reason == 202/*AUTH_FAIL*/ || reason == 203/*ASSOC_FAIL*/) {
_status = WL_CONNECT_FAILED;
} else {
_status = WL_DISCONNECTED;
}
break;
}
case SYSTEM_EVENT_STA_LOST_IP:
memset(&_ipInfo, 0x00, sizeof(_ipInfo));
_status = WL_CONNECTION_LOST;
break;
case SYSTEM_EVENT_AP_START: {
struct netif* apNetif;
if (tcpip_adapter_get_netif(TCPIP_ADAPTER_IF_AP, (void**)&apNetif) == ESP_OK) {
if (apNetif->input != WiFiClass::apNetifInputHandler) {
_apNetifInput = apNetif->input;
apNetif->input = WiFiClass::apNetifInputHandler;
}
}
wifi_config_t config;
esp_wifi_get_config(ESP_IF_WIFI_AP, &config);
memcpy(_apRecord.ssid, config.ap.ssid, sizeof(config.ap.ssid));
_apRecord.authmode = config.ap.authmode;
if (_ipInfo.ip.addr) {
// custom static IP
tcpip_adapter_dhcps_stop(TCPIP_ADAPTER_IF_AP);
tcpip_adapter_set_ip_info(TCPIP_ADAPTER_IF_AP, &_ipInfo);
tcpip_adapter_dhcps_start(TCPIP_ADAPTER_IF_AP);
} else {
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_AP, &_ipInfo);
}
_status = WL_AP_LISTENING;
xEventGroupSetBits(_eventGroup, BIT1);
break;
}
case SYSTEM_EVENT_AP_STOP:
_status = WL_IDLE_STATUS;
memset(&_apRecord, 0x00, sizeof(_apRecord));
memset(&_ipInfo, 0x00, sizeof(_ipInfo));
xEventGroupClearBits(_eventGroup, BIT1);
break;
case SYSTEM_EVENT_AP_STACONNECTED:
_status = WL_AP_CONNECTED;
break;
case SYSTEM_EVENT_AP_STADISCONNECTED:
wifi_sta_list_t staList;
esp_wifi_ap_get_sta_list(&staList);
if (staList.num == 0) {
_status = WL_AP_LISTENING;
}
break;
default:
break;
}
}
WiFiClass WiFi;

View file

@ -0,0 +1,129 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WIFI_H
#define WIFI_H
#include <esp_event_loop.h>
#include <freertos/FreeRTOS.h>
#include <freertos/event_groups.h>
#include <lwip/netif.h>
#include <Arduino.h>
typedef enum {
WL_NO_SHIELD = 255,
WL_IDLE_STATUS = 0,
WL_NO_SSID_AVAIL,
WL_SCAN_COMPLETED,
WL_CONNECTED,
WL_CONNECT_FAILED,
WL_CONNECTION_LOST,
WL_DISCONNECTED,
WL_AP_LISTENING,
WL_AP_CONNECTED,
WL_AP_FAILED,
} wl_status_t;
#define MAX_SCAN_RESULTS 10
class WiFiClass
{
public:
WiFiClass();
uint8_t begin(const char* ssid);
uint8_t begin(const char* ssid, uint8_t key_idx, const char* key);
uint8_t begin(const char* ssid, const char* key);
uint8_t beginAP(const char *ssid, uint8_t channel);
uint8_t beginAP(const char *ssid, uint8_t key_idx, const char* key, uint8_t channel);
uint8_t beginAP(const char *ssid, const char* key, uint8_t channel);
void config(/*IPAddress*/uint32_t local_ip, /*IPAddress*/uint32_t gateway, /*IPAddress*/uint32_t subnet);
void setDNS(/*IPAddress*/uint32_t dns_server1, /*IPAddress*/uint32_t dns_server2);
void hostname(const char* name);
void disconnect();
void end();
uint8_t* macAddress(uint8_t* mac);
uint32_t localIP();
uint32_t subnetMask();
uint32_t gatewayIP();
char* SSID();
int32_t RSSI();
uint8_t encryptionType();
uint8_t* BSSID(uint8_t* bssid);
int8_t scanNetworks();
char* SSID(uint8_t pos);
int32_t RSSI(uint8_t pos);
uint8_t encryptionType(uint8_t pos);
uint8_t* BSSID(uint8_t pos, uint8_t* bssid);
uint8_t channel(uint8_t pos);
uint8_t status();
int hostByName(const char* hostname, /*IPAddress*/uint32_t& result);
int ping(/*IPAddress*/uint32_t host, uint8_t ttl);
unsigned long getTime();
void lowPowerMode();
void noLowPowerMode();
void onReceive(void(*)(void));
private:
void init();
static esp_err_t systemEventHandler(void* ctx, system_event_t* event);
void handleSystemEvent(system_event_t* event);
static err_t staNetifInputHandler(struct pbuf* p, struct netif* inp);
static err_t apNetifInputHandler(struct pbuf* p, struct netif* inp);
err_t handleStaNetifInput(struct pbuf* p, struct netif* inp);
err_t handleApNetifInput(struct pbuf* p, struct netif* inp);
private:
bool _initialized;
volatile uint8_t _status;
EventGroupHandle_t _eventGroup;
esp_interface_t _interface;
wifi_ap_record_t _scanResults[MAX_SCAN_RESULTS];
wifi_ap_record_t _apRecord;
tcpip_adapter_ip_info_t _ipInfo;
netif_input_fn _staNetifInput;
netif_input_fn _apNetifInput;
void (*_onReceiveCallback)(void);
};
extern WiFiClass WiFi;
#endif // WIFI_H

View file

@ -0,0 +1,215 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <errno.h>
#include <string.h>
#include <lwip/netdb.h>
#include <lwip/sockets.h>
#include "WiFiClient.h"
WiFiClient::WiFiClient() :
WiFiClient(-1)
{
}
WiFiClient::WiFiClient(int socket) :
_socket(socket)
{
}
int WiFiClient::connect(const char* host, uint16_t port)
{
struct hostent* server = gethostbyname(host);
if (server == NULL) {
return 0;
}
return connect(server->h_addr, port);
}
int WiFiClient::connect(/*IPAddress*/uint32_t ip, uint16_t port)
{
_socket = lwip_socket(AF_INET, SOCK_STREAM, 0);
if (_socket < 0) {
_socket = -1;
return 0;
}
struct sockaddr_in addr;
memset(&addr, 0x00, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = (uint32_t)ip;
addr.sin_port = htons(port);
if (lwip_connect_r(_socket, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
lwip_close_r(_socket);
_socket = -1;
return 0;
}
int nonBlocking = 1;
lwip_ioctl_r(_socket, FIONBIO, &nonBlocking);
return 1;
}
size_t WiFiClient::write(uint8_t b)
{
return write(&b, 1);
}
size_t WiFiClient::write(const uint8_t *buf, size_t size)
{
if (_socket == -1) {
return 0;
}
int result = lwip_send_r(_socket, (void*)buf, size, MSG_DONTWAIT);
if (result < 0) {
lwip_close_r(_socket);
_socket = -1;
return 0;
}
return result;
}
int WiFiClient::available()
{
if (_socket == -1) {
return 0;
}
int result = 0;
if (lwip_ioctl_r(_socket, FIONREAD, &result) < 0) {
lwip_close_r(_socket);
_socket = -1;
return 0;
}
return result;
}
int WiFiClient::read()
{
uint8_t b;
if (read(&b, sizeof(b)) == -1) {
return -1;
}
return b;
}
int WiFiClient::read(uint8_t* buf, size_t size)
{
if (!available()) {
return -1;
}
int result = lwip_recv_r(_socket, buf, size, MSG_DONTWAIT);
if (result <= 0 && errno != EWOULDBLOCK) {
lwip_close_r(_socket);
_socket = -1;
return 0;
}
if (result == 0) {
result = -1;
}
return result;
}
int WiFiClient::peek()
{
uint8_t b;
if (recv(_socket, &b, sizeof(b), MSG_PEEK | MSG_DONTWAIT) <= 0) {
if (errno != EWOULDBLOCK) {
lwip_close_r(_socket);
_socket = -1;
}
return -1;
}
return b;
}
void WiFiClient::flush()
{
}
void WiFiClient::stop()
{
if (_socket != -1) {
lwip_close_r(_socket);
_socket = -1;
}
}
uint8_t WiFiClient::connected()
{
if (_socket != -1) {
// use peek to update socket state
peek();
}
return (_socket != -1);
}
WiFiClient::operator bool()
{
return (_socket != -1);
}
bool WiFiClient::operator==(const WiFiClient &other) const
{
return (_socket == other._socket);
}
/*IPAddress*/uint32_t WiFiClient::remoteIP()
{
struct sockaddr_storage addr;
socklen_t len = sizeof(addr);
getpeername(_socket, (struct sockaddr*)&addr, &len);
return ((struct sockaddr_in *)&addr)->sin_addr.s_addr;
}
uint16_t WiFiClient::remotePort()
{
struct sockaddr_storage addr;
socklen_t len = sizeof(addr);
getpeername(_socket, (struct sockaddr*)&addr, &len);
return ntohs(((struct sockaddr_in *)&addr)->sin_port);
}

View file

@ -0,0 +1,64 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WIFICLIENT_H
#define WIFICLIENT_H
#include <Arduino.h>
// #include <Client.h>
// #include <IPAddress.h>
class WiFiServer;
class WiFiClient /*: public Client*/ {
public:
WiFiClient();
uint8_t status();
virtual int connect(/*IPAddress*/uint32_t ip, uint16_t port);
virtual int connect(const char* host, uint16_t port);
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
virtual int available();
virtual int read();
virtual int read(uint8_t *buf, size_t size);
virtual int peek();
virtual void flush();
virtual void stop();
virtual uint8_t connected();
virtual operator bool();
bool operator==(const WiFiClient &other) const;
virtual /*IPAddress*/uint32_t remoteIP();
virtual uint16_t remotePort();
// using Print::write;
protected:
friend class WiFiServer;
WiFiClient(int socket);
private:
int _socket;
};
#endif // WIFICLIENT_H

View file

@ -0,0 +1,285 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <lwip/netdb.h>
#include <lwip/sockets.h>
#include "esp_partition.h"
#include "WiFiSSLClient.h"
class __Guard {
public:
__Guard(SemaphoreHandle_t handle) {
_handle = handle;
xSemaphoreTakeRecursive(_handle, portMAX_DELAY);
}
~__Guard() {
xSemaphoreGiveRecursive(_handle);
}
private:
SemaphoreHandle_t _handle;
};
#define synchronized __Guard __guard(_mbedMutex);
WiFiSSLClient::WiFiSSLClient() :
_connected(false),
_peek(-1)
{
_netContext.fd = -1;
_mbedMutex = xSemaphoreCreateRecursiveMutex();
}
int WiFiSSLClient::connect(const char* host, uint16_t port)
{
synchronized {
_netContext.fd = -1;
_connected = false;
mbedtls_ssl_init(&_sslContext);
mbedtls_ctr_drbg_init(&_ctrDrbgContext);
mbedtls_ssl_config_init(&_sslConfig);
mbedtls_entropy_init(&_entropyContext);
mbedtls_x509_crt_init(&_caCrt);
mbedtls_net_init(&_netContext);
if (mbedtls_ctr_drbg_seed(&_ctrDrbgContext, mbedtls_entropy_func, &_entropyContext, NULL, 0) != 0) {
stop();
return 0;
}
if (mbedtls_ssl_config_defaults(&_sslConfig, MBEDTLS_SSL_IS_CLIENT, MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT) != 0) {
stop();
return 0;
}
mbedtls_ssl_conf_authmode(&_sslConfig, MBEDTLS_SSL_VERIFY_REQUIRED);
spi_flash_mmap_handle_t handle;
const unsigned char* certs_data = {};
const esp_partition_t* part = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, "certs");
if (part == NULL)
{
return 0;
}
int ret = esp_partition_mmap(part, 0, part->size, SPI_FLASH_MMAP_DATA, (const void**)&certs_data, &handle);
if (ret != ESP_OK)
{
return 0;
}
ret = mbedtls_x509_crt_parse(&_caCrt, certs_data, strlen((char*)certs_data) + 1);
if (ret < 0) {
stop();
return 0;
}
mbedtls_ssl_conf_ca_chain(&_sslConfig, &_caCrt, NULL);
mbedtls_ssl_conf_rng(&_sslConfig, mbedtls_ctr_drbg_random, &_ctrDrbgContext);
if (mbedtls_ssl_setup(&_sslContext, &_sslConfig) != 0) {
stop();
return 0;
}
char portStr[6];
itoa(port, portStr, 10);
if (mbedtls_net_connect(&_netContext, host, portStr, MBEDTLS_NET_PROTO_TCP) != 0) {
stop();
return 0;
}
mbedtls_ssl_set_bio(&_sslContext, &_netContext, mbedtls_net_send, mbedtls_net_recv, NULL);
int result;
do {
result = mbedtls_ssl_handshake(&_sslContext);
} while (result == MBEDTLS_ERR_SSL_WANT_READ || result == MBEDTLS_ERR_SSL_WANT_WRITE);
if (result != 0) {
stop();
return 0;
}
mbedtls_net_set_nonblock(&_netContext);
_connected = true;
return 1;
}
}
int WiFiSSLClient::connect(/*IPAddress*/uint32_t ip, uint16_t port)
{
char ipStr[16];
sprintf(ipStr, "%d.%d.%d.%d", ((ip & 0xff000000) >> 24), ((ip & 0x00ff0000) >> 16), ((ip & 0x0000ff00) >> 8), ((ip & 0x000000ff) >> 0)/*ip[0], ip[1], ip[2], ip[3]*/);
return connect(ipStr, port);
}
size_t WiFiSSLClient::write(uint8_t b)
{
return write(&b, 1);
}
size_t WiFiSSLClient::write(const uint8_t *buf, size_t size)
{
synchronized {
int written = mbedtls_ssl_write(&_sslContext, buf, size);
if (written < 0) {
written = 0;
}
return written;
}
}
int WiFiSSLClient::available()
{
synchronized {
int result = mbedtls_ssl_read(&_sslContext, NULL, 0);
int n = mbedtls_ssl_get_bytes_avail(&_sslContext);
if (n == 0 && result != 0 && result != MBEDTLS_ERR_SSL_WANT_READ) {
stop();
}
return n;
}
}
int WiFiSSLClient::read()
{
uint8_t b;
if (_peek != -1) {
b = _peek;
_peek = -1;
} else if (read(&b, sizeof(b)) == -1) {
return -1;
}
return b;
}
int WiFiSSLClient::read(uint8_t* buf, size_t size)
{
synchronized {
if (!available()) {
return -1;
}
int result = mbedtls_ssl_read(&_sslContext, buf, size);
if (result < 0) {
if (result != MBEDTLS_ERR_SSL_WANT_READ && result != MBEDTLS_ERR_SSL_WANT_WRITE) {
stop();
}
return -1;
}
return result;
}
}
int WiFiSSLClient::peek()
{
if (_peek == -1) {
_peek = read();
}
return _peek;
}
void WiFiSSLClient::flush()
{
}
void WiFiSSLClient::stop()
{
synchronized {
if (_netContext.fd > 0) {
mbedtls_ssl_session_reset(&_sslContext);
mbedtls_net_free(&_netContext);
mbedtls_x509_crt_free(&_caCrt);
mbedtls_entropy_free(&_entropyContext);
mbedtls_ssl_config_free(&_sslConfig);
mbedtls_ctr_drbg_free(&_ctrDrbgContext);
mbedtls_ssl_free(&_sslContext);
}
_connected = false;
_netContext.fd = -1;
}
vTaskDelay(1);
}
uint8_t WiFiSSLClient::connected()
{
synchronized {
if (!_connected) {
return 0;
}
if (available()) {
return 1;
}
return 1;
}
}
WiFiSSLClient::operator bool()
{
return ((_netContext.fd != -1) && _connected);
}
/*IPAddress*/uint32_t WiFiSSLClient::remoteIP()
{
struct sockaddr_storage addr;
socklen_t len = sizeof(addr);
getpeername(_netContext.fd, (struct sockaddr*)&addr, &len);
return ((struct sockaddr_in *)&addr)->sin_addr.s_addr;
}
uint16_t WiFiSSLClient::remotePort()
{
struct sockaddr_storage addr;
socklen_t len = sizeof(addr);
getpeername(_netContext.fd, (struct sockaddr*)&addr, &len);
return ntohs(((struct sockaddr_in *)&addr)->sin_port);
}

View file

@ -0,0 +1,73 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WIFISSLCLIENT_H
#define WIFISSLCLIENT_H
#include <mbedtls/net.h>
#include <mbedtls/ssl.h>
#include <mbedtls/entropy.h>
#include <mbedtls/ctr_drbg.h>
#include <mbedtls/error.h>
#include <Arduino.h>
// #include <Client.h>
// #include <IPAddress.h>
class WiFiSSLClient /*: public Client*/ {
public:
WiFiSSLClient();
uint8_t status();
virtual int connect(/*IPAddress*/uint32_t ip, uint16_t port);
virtual int connect(const char* host, uint16_t port);
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
virtual int available();
virtual int read();
virtual int read(uint8_t *buf, size_t size);
virtual int peek();
virtual void flush();
virtual void stop();
virtual uint8_t connected();
virtual operator bool();
// using Print::write;
virtual /*IPAddress*/uint32_t remoteIP();
virtual uint16_t remotePort();
private:
static const char* ROOT_CAs;
mbedtls_entropy_context _entropyContext;
mbedtls_ctr_drbg_context _ctrDrbgContext;
mbedtls_ssl_context _sslContext;
mbedtls_ssl_config _sslConfig;
mbedtls_net_context _netContext;
mbedtls_x509_crt _caCrt;
bool _connected;
int _peek;
SemaphoreHandle_t _mbedMutex;
};
#endif /* WIFISSLCLIENT_H */

View file

@ -0,0 +1,142 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <errno.h>
#include <string.h>
#include <lwip/sockets.h>
#include "WiFiClient.h"
#include "WiFiServer.h"
WiFiServer::WiFiServer() :
WiFiServer(0)
{
}
WiFiServer::WiFiServer(uint16_t port) :
_port(port),
_socket(-1)
{
for (int i = 0; i < CONFIG_LWIP_MAX_SOCKETS; i++) {
_spawnedSockets[i] = -1;
}
}
void WiFiServer::begin()
{
_socket = lwip_socket(AF_INET, SOCK_STREAM, 0);
if (_socket < 0) {
return;
}
struct sockaddr_in addr;
memset(&addr, 0x00, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = (uint32_t)0;
addr.sin_port = htons(_port);
if (lwip_bind(_socket, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
lwip_close_r(_socket);
_socket = -1;
return;
}
if (lwip_listen(_socket, 1) < 0) {
lwip_close_r(_socket);
_socket = -1;
return;
}
int nonBlocking = 1;
lwip_ioctl_r(_socket, FIONBIO, &nonBlocking);
return;
}
WiFiClient WiFiServer::available(uint8_t* status)
{
int result = lwip_accept(_socket, NULL, 0);
if (status) {
*status = (result != -1);
}
if (result != -1) {
// store the connected socket
for (int i = 0; i < CONFIG_LWIP_MAX_SOCKETS; i++) {
if (_spawnedSockets[i] == -1) {
_spawnedSockets[i] = result;
break;
}
}
}
result = -1;
// find an existing socket with data
for (int i = 0; i < CONFIG_LWIP_MAX_SOCKETS; i++) {
if (_spawnedSockets[i] != -1) {
WiFiClient c(_spawnedSockets[i]);
if (!c.connected()) {
// socket not connected, clear from book keeping
_spawnedSockets[i] = -1;
} else if (c.available()) {
result = _spawnedSockets[i];
break;
}
}
}
return WiFiClient(result);
}
uint8_t WiFiServer::status() {
// Deprecated.
return 0;
}
size_t WiFiServer::write(uint8_t b)
{
return write(&b, 1);
}
size_t WiFiServer::write(const uint8_t *buffer, size_t size)
{
size_t written = 0;
for (int i = 0; i < CONFIG_LWIP_MAX_SOCKETS; i++) {
if (_spawnedSockets[i] != -1) {
WiFiClient c(_spawnedSockets[i]);
written += c.write(buffer, size);
}
}
return written;
}
WiFiServer::operator bool()
{
return (_port != 0 && _socket != -1);
}

View file

@ -0,0 +1,50 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WIFISERVER_H
#define WIFISERVER_H
#include <sdkconfig.h>
#include <Arduino.h>
// #include <Server.h>
class WiFiClient;
class WiFiServer /*: public Server*/ {
public:
WiFiServer();
WiFiServer(uint16_t);
WiFiClient available(uint8_t* status = NULL);
void begin();
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buf, size_t size);
uint8_t status();
// using Print::write;
virtual operator bool();
private:
uint16_t _port;
int _socket;
int _spawnedSockets[CONFIG_LWIP_MAX_SOCKETS];
};
#endif // WIFISERVER_H

View file

@ -0,0 +1,218 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <errno.h>
#include <string.h>
#include <lwip/netdb.h>
#include <lwip/sockets.h>
#include "WiFiUdp.h"
WiFiUDP::WiFiUDP() :
_socket(-1),
_remoteIp(0),
_remotePort(0),
_rcvIndex(0),
_rcvSize(0),
_sndSize(0)
{
}
uint8_t WiFiUDP::begin(uint16_t port)
{
_socket = lwip_socket(AF_INET, SOCK_DGRAM, 0);
if (_socket < 0) {
return 0;
}
struct sockaddr_in addr;
memset(&addr, 0x00, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = (uint32_t)0;
addr.sin_port = htons(port);
if (lwip_bind(_socket, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
lwip_close_r(_socket);
_socket = -1;
return 0;
}
int nonBlocking = 1;
lwip_ioctl_r(_socket, FIONBIO, &nonBlocking);
return 1;
}
uint8_t WiFiUDP::beginMulticast(/*IPAddress*/uint32_t ip, uint16_t port)
{
if (!begin(port)) {
return 0;
}
struct ip_mreq multi;
multi.imr_multiaddr.s_addr = (uint32_t)ip;
multi.imr_interface.s_addr = (uint32_t)0;
lwip_setsockopt_r(_socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, &multi, sizeof(multi));
return 1;
}
/* return number of bytes available in the current packet,
will return zero if parsePacket hasn't been called yet */
int WiFiUDP::available()
{
return (_rcvSize - _rcvIndex);
}
/* Release any resources being used by this WiFiUDP instance */
void WiFiUDP::stop()
{
lwip_close_r(_socket);
_socket = -1;
}
int WiFiUDP::beginPacket(const char *host, uint16_t port)
{
struct hostent* server = gethostbyname(host);
if (server == NULL) {
return 0;
}
return beginPacket(server->h_addr, port);
}
int WiFiUDP::beginPacket(/*IPAddress*/uint32_t ip, uint16_t port)
{
_remoteIp = ip;
_remotePort = port;
_sndSize = 0;
return 1;
}
int WiFiUDP::endPacket()
{
struct sockaddr_in addr;
memset(&addr, 0x00, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = _remoteIp;
addr.sin_port = htons(_remotePort);
if (lwip_sendto(_socket, _sndBuffer, _sndSize, 0, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
return 0;
}
return 1;
}
size_t WiFiUDP::write(uint8_t byte)
{
return write(&byte, 1);
}
size_t WiFiUDP::write(const uint8_t *buffer, size_t size)
{
size_t written = size;
if ((_sndSize + size) > sizeof(_sndBuffer)) {
written = sizeof(_sndBuffer) - _sndSize;
}
memcpy(&_sndBuffer[_sndSize], buffer, size);
_sndSize += written;
return written;
}
int WiFiUDP::parsePacket()
{
struct sockaddr_in addr;
socklen_t addrLen = sizeof(addr);
_rcvIndex = 0;
_rcvSize = 0;
int result = lwip_recvfrom_r(_socket, _rcvBuffer, sizeof(_rcvBuffer), MSG_DONTWAIT, (struct sockaddr*)&addr, &addrLen);
if (result <= 0) {
return 0;
}
_rcvSize = result;
_remoteIp = addr.sin_addr.s_addr;
_remotePort = ntohs(addr.sin_port);
return result;
}
int WiFiUDP::read()
{
uint8_t b;
if (read(&b, sizeof(b)) < 1) {
return -1;
}
return b;
}
int WiFiUDP::read(unsigned char* buf, size_t size)
{
if (available() < (int)size) {
size = available();
}
memcpy(buf, &_rcvBuffer[_rcvIndex], size);
_rcvIndex += size;
return size;
}
int WiFiUDP::peek()
{
if (!available()) {
return -1;
}
return _rcvBuffer[_rcvIndex];
}
void WiFiUDP::flush()
{
}
/*IPAddress*/uint32_t WiFiUDP::remoteIP()
{
return _remoteIp;
}
uint16_t WiFiUDP::remotePort()
{
return _remotePort;
}

View file

@ -0,0 +1,66 @@
/*
This file is part of the Arduino NINA firmware.
Copyright (c) 2018 Arduino SA. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef WIFIUDP_H
#define WIFIUDP_H
// #include <Udp.h>
class WiFiUDP /*: public UDP*/ {
public:
WiFiUDP();
virtual uint8_t begin(uint16_t);
virtual uint8_t beginMulticast(/*IPAddress*/uint32_t, uint16_t);
virtual void stop();
virtual int beginPacket(/*IPAddress*/uint32_t ip, uint16_t port);
virtual int beginPacket(const char *host, uint16_t port);
virtual int endPacket();
virtual size_t write(uint8_t);
virtual size_t write(const uint8_t *buffer, size_t size);
// using Print::write;
virtual int parsePacket();
virtual int available();
virtual int read();
virtual int read(unsigned char* buffer, size_t len);
virtual int read(char* buffer, size_t len) { return read((unsigned char*)buffer, len); };
virtual int peek();
virtual void flush();
virtual /*IPAddress*/ uint32_t remoteIP();
virtual uint16_t remotePort();
virtual operator bool() { return _socket != -1; }
private:
int _socket;
uint32_t _remoteIp;
uint16_t _remotePort;
uint8_t _rcvBuffer[1500];
uint16_t _rcvIndex;
uint16_t _rcvSize;
uint8_t _sndBuffer[1500];
uint16_t _sndSize;
};
#endif // WIFIUDP_H

View file

@ -1,3 +0,0 @@
idf_component_register(
INCLUDE_DIRS . ${BOARD}
)

View file

@ -1,18 +0,0 @@
#ifndef BOARD_H
#define BOARD_H
// SPIS for WiFi
#define AIRLIFT_MOSI 14
#define AIRLIFT_MISO 23
#define AIRLIFT_SCK 18
#define AIRLIFT_CS 5
#define AIRLIFT_BUSY 33 // ready
// UART for BLE HCI
#define AIRLIFT_RTS AIRLIFT_BUSY
#define AIRLIFT_CTS 0 // BOOT PIN
// #define CONFIG_BT_LE_HCI_UART_RTS_PIN 33 // ESP_BUSY (ready)
// #define CONFIG_BT_LE_HCI_UART_CTS_PIN 0 // GPIO0
#endif

View file

@ -1,2 +0,0 @@
CONFIG_BTDM_CTRL_HCI_MODE_UART_H4=y
CONFIG_BTDM_CTRL_HCI_UART_BAUDRATE=115200

View file

@ -1,11 +0,0 @@
#ifndef BOARD_H
#define BOARD_H
// SPIS for WiFi
#define AIRLIFT_MOSI 21
#define AIRLIFT_MISO 6
#define AIRLIFT_SCK 22
#define AIRLIFT_CS 7
#define AIRLIFT_BUSY CONFIG_BT_LE_HCI_UART_RTS_PIN // 18, aka ready
#endif

View file

@ -1,9 +0,0 @@
# BT_LE_HCI
CONFIG_BT_LE_HCI_INTERFACE_USE_UART=y
CONFIG_BT_LE_HCI_UART_FLOWCTRL=y
CONFIG_BT_LE_HCI_UART_TX_PIN=16
CONFIG_BT_LE_HCI_UART_RX_PIN=17
CONFIG_BT_LE_HCI_UART_RTS_PIN=18
CONFIG_BT_LE_HCI_UART_CTS_PIN=9
CONFIG_BT_LE_HCI_UART_BAUD=115200
CONFIG_BT_LE_CONTROLLER_LOG_ENABLED=y

@ -1 +0,0 @@
Subproject commit 96174bf8bafd24c6b215fa065460a582a7624037

View file

@ -1,127 +0,0 @@
# Adafruit Community Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and leaders pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level or type of
experience, education, socio-economic status, nationality, personal appearance,
race, religion, or sexual identity and orientation.
## Our Standards
We are committed to providing a friendly, safe and welcoming environment for
all.
Examples of behavior that contributes to creating a positive environment
include:
* Be kind and courteous to others
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Collaborating with other community members
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and sexual attention or advances
* The use of inappropriate images, including in a community member's avatar
* The use of inappropriate language, including in a community member's nickname
* Any spamming, flaming, baiting or other attention-stealing behavior
* Excessive or unwelcome helping; answering outside the scope of the question
asked
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate
The goal of the standards and moderation guidelines outlined here is to build
and maintain a respectful community. We ask that you dont just aim to be
"technically unimpeachable", but rather try to be your best self.
We value many things beyond technical expertise, including collaboration and
supporting others within our community. Providing a positive experience for
other community members can have a much more significant impact than simply
providing the correct answer.
## Our Responsibilities
Project leaders are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project leaders have the right and responsibility to remove, edit, or
reject messages, comments, commits, code, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any community member for other behaviors that they deem
inappropriate, threatening, offensive, or harmful.
## Moderation
Instances of behaviors that violate the Adafruit Community Code of Conduct
may be reported by any member of the community. Community members are
encouraged to report these situations, including situations they witness
involving other community members.
You may report in the following ways:
In any situation, you may send an email to <support@adafruit.com>.
On the Adafruit Discord, you may send an open message from any channel
to all Community Helpers by tagging @community helpers. You may also send an
open message from any channel, or a direct message to @kattni#1507,
@tannewt#4653, @Dan Halbert#1614, @cater#2442, @sommersoft#0222, or
@Andon#8175.
Email and direct message reports will be kept confidential.
In situations on Discord where the issue is particularly egregious, possibly
illegal, requires immediate action, or violates the Discord terms of service,
you should also report the message directly to Discord.
These are the steps for upholding our communitys standards of conduct.
1. Any member of the community may report any situation that violates the
Adafruit Community Code of Conduct. All reports will be reviewed and
investigated.
2. If the behavior is an egregious violation, the community member who
committed the violation may be banned immediately, without warning.
3. Otherwise, moderators will first respond to such behavior with a warning.
4. Moderators follow a soft "three strikes" policy - the community member may
be given another chance, if they are receptive to the warning and change their
behavior.
5. If the community member is unreceptive or unreasonable when warned by a
moderator, or the warning goes unheeded, they may be banned for a first or
second offense. Repeated offenses will result in the community member being
banned.
## Scope
This Code of Conduct and the enforcement policies listed above apply to all
Adafruit Community venues. This includes but is not limited to any community
spaces (both public and private), the entire Adafruit Discord server, and
Adafruit GitHub repositories. Examples of Adafruit Community spaces include
but are not limited to meet-ups, audio chats on the Adafruit Discord, or
interaction at a conference.
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. As a community
member, you are representing our community, and are expected to behave
accordingly.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.4, available at
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
For other projects adopting the Adafruit Community Code of
Conduct, please contact the maintainers of those projects for enforcement.
If you wish to use this code of conduct for your own project, consider
explicitly mentioning your moderation policy or making a copy with your
own moderation policy so as to avoid confusion.

View file

@ -1,97 +1,35 @@
#!/usr/bin/env python
import json
import sys
import argparse
import os
booloaderData = open("build/bootloader/bootloader.bin", "rb").read()
partitionData = open("build/partitions.bin", "rb").read()
appData = open("build/nina-fw.bin", "rb").read()
certsData = open("data/roots.pem", "rb").read()
def extract_firmware_version():
with open('main/CommandHandler.cpp', 'r') as file:
for line in file:
if 'const char FIRMWARE_VERSION[] = ' in line:
# The line format is `const char FIRMWARE_VERSION[] = "2.0.0-adafruit";`
# Split by double quote and get the second element
version = line.split('"')[1]
return version
raise RuntimeError("FIRMWARE_VERSION not found in CommandHandler.cpp")
# calculate the output binary size, app offset
outputSize = 0x30000 + len(appData)
if (outputSize % 1024):
outputSize += 1024 - (outputSize % 1024)
def get_idf_target(build_dir):
with open(f"{build_dir}/config.env") as file:
config = json.load(file)
return config["IDF_TARGET"]
# allocate and init to 0xff
outputData = bytearray(b'\xff') * outputSize
def main():
parser = argparse.ArgumentParser()
parser.add_argument('outfile', help='output file')
parser.add_argument('-b', '--build_dir', default='build', help='build directory')
# copy data: bootloader, partitions, app
for i in range(0, len(booloaderData)):
outputData[0x1000 + i] = booloaderData[i]
args = parser.parse_args()
outfile = args.outfile
build_dir = os.path.normpath(args.build_dir)
for i in range(0, len(partitionData)):
outputData[0x8000 + i] = partitionData[i]
bootloaderData = open(f"{build_dir}/bootloader/bootloader.bin", "rb").read()
partitionData = open(f"{build_dir}/partition_table/partition-table.bin", "rb").read()
#phyData = open("data/phy.bin", "rb").read()
appData = open(f"{build_dir}/nina-fw.bin", "rb").read()
for i in range(0, len(appData)):
outputData[0x30000 + i] = appData[i]
# remove everything between certificate markers to save space. There might be comments and other information.
certsData = b""
with open("certificates/data/roots.pem", "rb") as certs_file:
in_cert = False
for line in certs_file:
if line.startswith(b"-----BEGIN CERTIFICATE-----"):
in_cert = True
if in_cert:
certsData += line
if line.startswith(b"-----END CERTIFICATE-----"):
in_cert = False
# calculate the output binary size, app offset
outputSize = 0x30000 + len(appData)
if outputSize % 1024:
outputSize += 1024 - (outputSize % 1024)
# allocate and init to 0xff
outputData = bytearray(b"\xff") * outputSize
# copy data: bootloader, partitions, app
BOOTLOADER_OFFSET = {
"esp32" : 0x1000,
"esp32c6" : 0x0000,
}
try:
idf_target = get_idf_target(build_dir)
bootloader_offset = BOOTLOADER_OFFSET[idf_target]
except KeyError:
raise RuntimeError(f"unsupported IDF_TARGET: {idf_target}")
for i in range(0, len(bootloaderData)):
outputData[bootloader_offset + i] = bootloaderData[i]
for i in range(0, len(partitionData)):
outputData[0x8000 + i] = partitionData[i]
#for i in range(0, len(phyData)):
# outputData[0xf000 + i] = phyData[i]
for i in range(0, len(certsData)):
for i in range(0, len(certsData)):
outputData[0x10000 + i] = certsData[i]
# zero terminate the pem file
outputData[0x10000 + len(certsData)] = 0
# zero terminate the pem file
outputData[0x10000 + len(certsData)] = 0
for i in range(0, len(appData)):
outputData[0x30000 + i] = appData[i]
version = extract_firmware_version()
outputFilename = f"{outfile}-{version}.bin"
# write out
with open(outputFilename, "w+b") as f:
f.seek(0)
f.write(outputData)
if __name__ == '__main__':
main()
# write out
with open("NINA_W102.bin","w+b") as f:
f.seek(0)
f.write(outputData)

View file

@ -1,4 +0,0 @@
idf_component_register(SRCS src/SPIS.cpp
INCLUDE_DIRS src
REQUIRES arduino-esp32
)

@ -1 +0,0 @@
Subproject commit dbaf6a3226317a7c5e452e7b8a15e54c86bc2b6a

Binary file not shown.

1000
data/roots.pem Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,5 +0,0 @@
idf_component_register(SRCS CommandHandler.cpp http_client.c sketch.ino.cpp
REQUIRES bt esp_http_client spiffs SPIS boards
PRIV_INCLUDE_DIRS "."
INCLUDE_DIRS "." $ENV{IDF_PATH}/components/esp_netif
)

File diff suppressed because it is too large Load diff

View file

@ -22,28 +22,19 @@
#include <stdint.h>
// include for esp_netif_recv_ret_t
#include "lwip/esp_netif_net_stack.h"
typedef esp_netif_recv_ret_t (*lwip_input_fn_t)(void *input_netif_handle, void *buffer, size_t len, void *eb);
class CommandHandlerClass {
public:
CommandHandlerClass();
void begin();
int handle(const uint8_t command[], uint8_t response[]);
static void onWiFiReceive();
static void onWiFiDisconnect(arduino_event_t*);
lwip_input_fn_t staNetifInput_orig = NULL;
lwip_input_fn_t apNetifInput_orig = NULL;
private:
static void gpio0Updater(void*);
static int ping(/*IPAddress*/uint32_t host, uint8_t ttl);
void updateGpio0Pin();
static void onWiFiReceive();
void handleWiFiReceive();
void handleWiFiDisconnect();
private:
SemaphoreHandle_t _updateGpio0PinSemaphore;
@ -51,6 +42,4 @@ private:
extern CommandHandlerClass CommandHandler;
extern "C" int downloadAndSaveFile(char * url, FILE * f, const char * cert_pem);
#endif

View file

@ -1,57 +0,0 @@
/*
This file is part of ArduinoIoTCloud.
Copyright 2019 ARDUINO SA (http://www.arduino.cc/)
This software is released under the GNU General Public License version 3,
which covers the main part of arduino-cli.
The terms of this license can be found at:
https://www.gnu.org/licenses/gpl-3.0.en.html
You can be released from the requirements of the above licenses by purchasing
a commercial license. Buying such a license is mandatory if you want to modify or
otherwise use the software for commercial activities involving the Arduino
software without disclosing the source code of your own applications. To purchase
a commercial license, send an email to license@arduino.cc.
*/
/******************************************************************************
* INCLUDE
******************************************************************************/
#include "CryptoUtil.h"
/******************************************************************************
* PUBLIC MEMBER FUNCTIONS
******************************************************************************/
bool CryptoUtil::readDeviceId(ECCX08Class & eccx08, String & device_id, ECCX08Slot const device_id_slot)
{
byte device_id_bytes[72] = {0};
if (eccx08.readSlot(static_cast<int>(device_id_slot), device_id_bytes, sizeof(device_id_bytes))) {
device_id = String(reinterpret_cast<char *>(device_id_bytes));
return true;
}
else
{
return false;
}
}
bool CryptoUtil::reconstructCertificate(ECCX08CertClass & cert, String const & device_id, ECCX08Slot const key, ECCX08Slot const compressed_certificate, ECCX08Slot const serial_number_and_authority_key)
{
if (cert.beginReconstruction(static_cast<int>(key), static_cast<int>(compressed_certificate), static_cast<int>(serial_number_and_authority_key)))
{
cert.setSubjectCommonName(device_id);
cert.setIssuerCountryName("US");
cert.setIssuerOrganizationName("Arduino LLC US");
cert.setIssuerOrganizationalUnitName("IT");
cert.setIssuerCommonName("Arduino");
return cert.endReconstruction();
}
else
{
return false;
}
}

View file

@ -1,60 +0,0 @@
/*
This file is part of ArduinoIoTCloud.
Copyright 2019 ARDUINO SA (http://www.arduino.cc/)
This software is released under the GNU General Public License version 3,
which covers the main part of arduino-cli.
The terms of this license can be found at:
https://www.gnu.org/licenses/gpl-3.0.en.html
You can be released from the requirements of the above licenses by purchasing
a commercial license. Buying such a license is mandatory if you want to modify or
otherwise use the software for commercial activities involving the Arduino
software without disclosing the source code of your own applications. To purchase
a commercial license, send an email to license@arduino.cc.
*/
#ifndef ARDUINO_IOT_CLOUD_UTILITY_CRYPTO_CRYPTO_UTIL_H_
#define ARDUINO_IOT_CLOUD_UTILITY_CRYPTO_CRYPTO_UTIL_H_
/******************************************************************************
* INCLUDE
******************************************************************************/
#include <Arduino.h>
#include <ArduinoECCX08.h>
#include "ECCX08Cert.h"
/******************************************************************************
TYPEDEF
******************************************************************************/
enum class ECCX08Slot : int
{
Key = 0,
CompressedCertificate = 10,
SerialNumberAndAuthorityKeyIdentifier = 11,
DeviceId = 12
};
/******************************************************************************
* CLASS DECLARATION
******************************************************************************/
class CryptoUtil
{
public:
static bool readDeviceId(ECCX08Class & eccx08, String & device_id, ECCX08Slot const device_id_slot);
static bool reconstructCertificate(ECCX08CertClass & cert, String const & device_id, ECCX08Slot const key, ECCX08Slot const compressed_certificate, ECCX08Slot const serial_number_and_authority_key);
private:
CryptoUtil() { }
CryptoUtil(CryptoUtil const & other) { }
};
#endif /* ARDUINO_IOT_CLOUD_UTILITY_CRYPTO_CRYPTO_UTIL_H_ */

View file

@ -1,940 +0,0 @@
/*
This file is part of ArduinoIoTCloud.
Copyright 2019 ARDUINO SA (http://www.arduino.cc/)
This software is released under the GNU General Public License version 3,
which covers the main part of arduino-cli.
The terms of this license can be found at:
https://www.gnu.org/licenses/gpl-3.0.en.html
You can be released from the requirements of the above licenses by purchasing
a commercial license. Buying such a license is mandatory if you want to modify or
otherwise use the software for commercial activities involving the Arduino
software without disclosing the source code of your own applications. To purchase
a commercial license, send an email to license@arduino.cc.
*/
/******************************************************************************
* INCLUDE
******************************************************************************/
#include "bearssl/bearssl_hash.h"
#include <ArduinoECCX08.h>
#include "ECCX08Cert.h"
/******************************************************************************
* DEFINE
******************************************************************************/
#define ASN1_INTEGER 0x02
#define ASN1_BIT_STRING 0x03
#define ASN1_NULL 0x05
#define ASN1_OBJECT_IDENTIFIER 0x06
#define ASN1_PRINTABLE_STRING 0x13
#define ASN1_SEQUENCE 0x30
#define ASN1_SET 0x31
struct __attribute__((__packed__)) CompressedCert {
byte signature[64];
byte dates[3];
byte unused[5];
};
#define SERIAL_NUMBER_LENGTH 16
#define AUTHORITY_KEY_IDENTIFIER_LENGTH 20
struct __attribute__((__packed__)) SerialNumberAndAuthorityKeyIdentifier {
byte serialNumber[SERIAL_NUMBER_LENGTH];
byte authorityKeyIdentifier[AUTHORITY_KEY_IDENTIFIER_LENGTH];
};
/******************************************************************************
* LOCAL MODULE FUNCTIONS
******************************************************************************/
static String base64Encode(const byte in[], unsigned int length, const char* prefix, const char* suffix) {
static const char* CODES = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
int b;
String out;
int reserveLength = 4 * ((length + 2) / 3) + ((length / 3 * 4) / 76) + strlen(prefix) + strlen(suffix);
out.reserve(reserveLength);
if (prefix) {
out += prefix;
}
for (unsigned int i = 0; i < length; i += 3) {
if (i > 0 && (i / 3 * 4) % 76 == 0) {
out += '\n';
}
b = (in[i] & 0xFC) >> 2;
out += CODES[b];
b = (in[i] & 0x03) << 4;
if (i + 1 < length) {
b |= (in[i + 1] & 0xF0) >> 4;
out += CODES[b];
b = (in[i + 1] & 0x0F) << 2;
if (i + 2 < length) {
b |= (in[i + 2] & 0xC0) >> 6;
out += CODES[b];
b = in[i + 2] & 0x3F;
out += CODES[b];
} else {
out += CODES[b];
out += '=';
}
} else {
out += CODES[b];
out += "==";
}
}
if (suffix) {
out += suffix;
}
return out;
}
/******************************************************************************
* CTOR/DTOR
******************************************************************************/
ECCX08CertClass::ECCX08CertClass() :
_keySlot(-1),
_compressedCertSlot(-1),
_serialNumberAndAuthorityKeyIdentifierSlot(-1),
_bytes(NULL),
_length(0) {
}
ECCX08CertClass::~ECCX08CertClass() {
if (_bytes) {
free(_bytes);
_bytes = NULL;
}
}
/******************************************************************************
* PUBLIC MEMBER FUNCTIONS
******************************************************************************/
int ECCX08CertClass::beginCSR(int keySlot, bool newPrivateKey) {
if (keySlot < 0 || keySlot > 8) {
return 0;
}
_keySlot = keySlot;
if (newPrivateKey) {
if (!ECCX08.generatePrivateKey(_keySlot, _temp)) {
return 0;
}
} else {
if (!ECCX08.generatePublicKey(_keySlot, _temp)) {
return 0;
}
}
return 1;
}
String ECCX08CertClass::endCSR() {
int versionLen = versionLength();
int subjectLen = issuerOrSubjectLength(_subjectCountryName,
_subjectStateProvinceName,
_subjectLocalityName,
_subjectOrganizationName,
_subjectOrganizationalUnitName,
_subjectCommonName);
int subjectHeaderLen = sequenceHeaderLength(subjectLen);
int publicKeyLen = publicKeyLength();
int csrInfoLen = versionLen + subjectHeaderLen + subjectLen + publicKeyLen + 2;
int csrInfoHeaderLen = sequenceHeaderLength(csrInfoLen);
byte csrInfo[csrInfoHeaderLen + csrInfoLen];
byte* out = csrInfo;
appendSequenceHeader(csrInfoLen, out);
out += csrInfoHeaderLen;
// version
appendVersion(0x00, out);
out += versionLen;
// subject
appendSequenceHeader(subjectLen, out);
out += subjectHeaderLen;
appendIssuerOrSubject(_subjectCountryName,
_subjectStateProvinceName,
_subjectLocalityName,
_subjectOrganizationName,
_subjectOrganizationalUnitName,
_subjectCommonName, out);
out += subjectLen;
// public key
appendPublicKey(_temp, out);
out += publicKeyLen;
// terminator
*out++ = 0xa0;
*out++ = 0x00;
br_sha256_context sha256Context;
byte csrInfoSha256[64];
byte signature[64];
br_sha256_init(&sha256Context);
br_sha256_update(&sha256Context, csrInfo, csrInfoHeaderLen + csrInfoLen);
br_sha256_out(&sha256Context, csrInfoSha256);
if (!ECCX08.ecSign(_keySlot, csrInfoSha256, signature)) {
return "";
}
int signatureLen = signatureLength(signature);
int csrLen = csrInfoHeaderLen + csrInfoLen + signatureLen;
int csrHeaderLen = sequenceHeaderLength(csrLen);
byte csr[csrLen + csrHeaderLen];
out = csr;
appendSequenceHeader(csrLen, out);
out += csrHeaderLen;
// info
memcpy(out, csrInfo, csrInfoHeaderLen + csrInfoLen);
out += (csrInfoHeaderLen + csrInfoLen);
// signature
appendSignature(signature, out);
out += signatureLen;
return base64Encode(csr, csrLen + csrHeaderLen, "-----BEGIN CERTIFICATE REQUEST-----\n", "\n-----END CERTIFICATE REQUEST-----\n");
}
int ECCX08CertClass::beginStorage(int compressedCertSlot, int serialNumberAndAuthorityKeyIdentifierSlot) {
if (compressedCertSlot < 8 || compressedCertSlot > 15) {
return 0;
}
if (serialNumberAndAuthorityKeyIdentifierSlot < 8 || serialNumberAndAuthorityKeyIdentifierSlot > 15) {
return 0;
}
_compressedCertSlot = compressedCertSlot;
_serialNumberAndAuthorityKeyIdentifierSlot = serialNumberAndAuthorityKeyIdentifierSlot;
memset(_temp, 0x00, sizeof(_temp));
return 1;
}
void ECCX08CertClass::setSignature(byte signature[]) {
struct CompressedCert* compressedCert = (struct CompressedCert*)_temp;
memcpy(compressedCert->signature, signature, 64);
}
void ECCX08CertClass::setIssueYear(int issueYear) {
struct CompressedCert* compressedCert = (struct CompressedCert*)_temp;
compressedCert->dates[0] &= 0x07;
compressedCert->dates[0] |= (issueYear - 2000) << 3;
}
void ECCX08CertClass::setIssueMonth(int issueMonth) {
struct CompressedCert* compressedCert = (struct CompressedCert*)_temp;
compressedCert->dates[0] &= 0xf8;
compressedCert->dates[0] |= issueMonth >> 1;
compressedCert->dates[1] &= 0x7f;
compressedCert->dates[1] |= issueMonth << 7;
}
void ECCX08CertClass::setIssueDay(int issueDay) {
struct CompressedCert* compressedCert = (struct CompressedCert*)_temp;
compressedCert->dates[1] &= 0x83;
compressedCert->dates[1] |= issueDay << 2;
}
void ECCX08CertClass::setIssueHour(int issueHour) {
struct CompressedCert* compressedCert = (struct CompressedCert*)_temp;
compressedCert->dates[2] &= 0x1f;
compressedCert->dates[2] |= issueHour << 5;
compressedCert->dates[1] &= 0xfc;
compressedCert->dates[1] |= issueHour >> 3;
}
void ECCX08CertClass::setExpireYears(int expireYears) {
struct CompressedCert* compressedCert = (struct CompressedCert*)_temp;
compressedCert->dates[2] &= 0xe0;
compressedCert->dates[2] |= expireYears;
}
void ECCX08CertClass::setSerialNumber(const byte serialNumber[]) {
memcpy(&_temp[72], serialNumber, SERIAL_NUMBER_LENGTH);
}
void ECCX08CertClass::setAuthorityKeyIdentifier(const byte authorityKeyIdentifier[]) {
memcpy(&_temp[88], authorityKeyIdentifier, AUTHORITY_KEY_IDENTIFIER_LENGTH);
}
int ECCX08CertClass::endStorage() {
if (!ECCX08.writeSlot(_compressedCertSlot, &_temp[0], 72)) {
return 0;
}
if (!ECCX08.writeSlot(_serialNumberAndAuthorityKeyIdentifierSlot, &_temp[72], SERIAL_NUMBER_LENGTH + AUTHORITY_KEY_IDENTIFIER_LENGTH)) {
return 0;
}
return 1;
}
int ECCX08CertClass::beginReconstruction(int keySlot, int compressedCertSlot, int serialNumberAndAuthorityKeyIdentifierSlot) {
if (keySlot < 0 || keySlot > 8) {
return 0;
}
if (compressedCertSlot < 8 || compressedCertSlot > 15) {
return 0;
}
if (serialNumberAndAuthorityKeyIdentifierSlot < 8 || serialNumberAndAuthorityKeyIdentifierSlot > 15) {
return 0;
}
_keySlot = keySlot;
_compressedCertSlot = compressedCertSlot;
_serialNumberAndAuthorityKeyIdentifierSlot = serialNumberAndAuthorityKeyIdentifierSlot;
return 1;
}
int ECCX08CertClass::endReconstruction() {
byte publicKey[64];
struct CompressedCert compressedCert;
struct SerialNumberAndAuthorityKeyIdentifier serialNumberAndAuthorityKeyIdentifier;
if (!ECCX08.generatePublicKey(_keySlot, publicKey)) {
return 0;
}
if (!ECCX08.readSlot(_compressedCertSlot, (byte*)&compressedCert, sizeof(compressedCert))) {
return 0;
}
if (!ECCX08.readSlot(_serialNumberAndAuthorityKeyIdentifierSlot, (byte*)&serialNumberAndAuthorityKeyIdentifier, sizeof(serialNumberAndAuthorityKeyIdentifier))) {
return 0;
}
// dates
int year = (compressedCert.dates[0] >> 3) + 2000;
int month = ((compressedCert.dates[0] & 0x07) << 1) | (compressedCert.dates[1] >> 7);
int day = (compressedCert.dates[1] & 0x7c) >> 2;
int hour = ((compressedCert.dates[1] & 0x03) << 3) | (compressedCert.dates[2] >> 5);
int expireYears = (compressedCert.dates[2] & 0x1f);
int datesSize = 30;
if (year > 2049) {
// two more bytes for GeneralizedTime
datesSize += 2;
}
if ((year + expireYears) > 2049) {
// two more bytes for GeneralizedTime
datesSize += 2;
}
int serialNumberLen = serialNumberLength(serialNumberAndAuthorityKeyIdentifier.serialNumber);
int issuerLen = issuerOrSubjectLength(_issuerCountryName,
_issuerStateProvinceName,
_issuerLocalityName,
_issuerOrganizationName,
_issuerOrganizationalUnitName,
_issuerCommonName);
int issuerHeaderLen = sequenceHeaderLength(issuerLen);
int subjectLen = issuerOrSubjectLength(_subjectCountryName,
_subjectStateProvinceName,
_subjectLocalityName,
_subjectOrganizationName,
_subjectOrganizationalUnitName,
_subjectCommonName);
int subjectHeaderLen = sequenceHeaderLength(subjectLen);
int publicKeyLen = publicKeyLength();
int authorityKeyIdentifierLen = authorityKeyIdentifierLength(serialNumberAndAuthorityKeyIdentifier.authorityKeyIdentifier);
int signatureLen = signatureLength(compressedCert.signature);
int certInfoLen = 5 + serialNumberLen + 12 + issuerHeaderLen + issuerLen + (datesSize + 2) +
subjectHeaderLen + subjectLen + publicKeyLen;
if (authorityKeyIdentifierLen) {
certInfoLen += authorityKeyIdentifierLen;
} else {
certInfoLen += 4;
}
int certInfoHeaderLen = sequenceHeaderLength(certInfoLen);
int certDataLen = certInfoLen + certInfoHeaderLen + signatureLen;
int certDataHeaderLen = sequenceHeaderLength(certDataLen);
_length = certDataLen + certDataHeaderLen;
_bytes = (byte*)realloc(_bytes, _length);
if (!_bytes) {
_length = 0;
return 0;
}
byte* out = _bytes;
appendSequenceHeader(certDataLen, out);
out += certDataHeaderLen;
appendSequenceHeader(certInfoLen, out);
out += certInfoHeaderLen;
// version
*out++ = 0xA0;
*out++ = 0x03;
*out++ = 0x02;
*out++ = 0x01;
*out++ = 0x02;
// serial number
appendSerialNumber(serialNumberAndAuthorityKeyIdentifier.serialNumber, out);
out += serialNumberLen;
// ecdsaWithSHA256
out += appendEcdsaWithSHA256(out);
// issuer
appendSequenceHeader(issuerLen, out);
out += issuerHeaderLen;
appendIssuerOrSubject(_issuerCountryName,
_issuerStateProvinceName,
_issuerLocalityName,
_issuerOrganizationName,
_issuerOrganizationalUnitName,
_issuerCommonName, out);
out += issuerLen;
*out++ = ASN1_SEQUENCE;
*out++ = datesSize;
out += appendDate(year, month, day, hour, 0, 0, out);
out += appendDate(year + expireYears, month, day, hour, 0, 0, out);
// subject
appendSequenceHeader(subjectLen, out);
out += subjectHeaderLen;
appendIssuerOrSubject(_subjectCountryName,
_subjectStateProvinceName,
_subjectLocalityName,
_subjectOrganizationName,
_subjectOrganizationalUnitName,
_subjectCommonName, out);
out += subjectLen;
// public key
appendPublicKey(publicKey, out);
out += publicKeyLen;
if (authorityKeyIdentifierLen) {
appendAuthorityKeyIdentifier(serialNumberAndAuthorityKeyIdentifier.authorityKeyIdentifier, out);
out += authorityKeyIdentifierLen;
} else {
// null sequence
*out++ = 0xA3;
*out++ = 0x02;
*out++ = 0x30;
*out++ = 0x00;
}
// signature
appendSignature(compressedCert.signature, out);
out += signatureLen;
return 1;
}
byte* ECCX08CertClass::bytes() {
return _bytes;
}
int ECCX08CertClass::length() {
return _length;
}
void ECCX08CertClass::setIssuerCountryName(const String& countryName) {
_issuerCountryName = countryName;
}
void ECCX08CertClass::setIssuerStateProvinceName(const String& stateProvinceName) {
_issuerStateProvinceName = stateProvinceName;
}
void ECCX08CertClass::setIssuerLocalityName(const String& localityName) {
_issuerLocalityName = localityName;
}
void ECCX08CertClass::setIssuerOrganizationName(const String& organizationName) {
_issuerOrganizationName = organizationName;
}
void ECCX08CertClass::setIssuerOrganizationalUnitName(const String& organizationalUnitName) {
_issuerOrganizationalUnitName = organizationalUnitName;
}
void ECCX08CertClass::setIssuerCommonName(const String& commonName) {
_issuerCommonName = commonName;
}
void ECCX08CertClass::setSubjectCountryName(const String& countryName) {
_subjectCountryName = countryName;
}
void ECCX08CertClass::setSubjectStateProvinceName(const String& stateProvinceName) {
_subjectStateProvinceName = stateProvinceName;
}
void ECCX08CertClass::setSubjectLocalityName(const String& localityName) {
_subjectLocalityName = localityName;
}
void ECCX08CertClass::setSubjectOrganizationName(const String& organizationName) {
_subjectOrganizationName = organizationName;
}
void ECCX08CertClass::setSubjectOrganizationalUnitName(const String& organizationalUnitName) {
_subjectOrganizationName = organizationalUnitName;
}
void ECCX08CertClass::setSubjectCommonName(const String& commonName) {
_subjectCommonName = commonName;
}
int ECCX08CertClass::versionLength() {
return 3;
}
int ECCX08CertClass::issuerOrSubjectLength(const String& countryName,
const String& stateProvinceName,
const String& localityName,
const String& organizationName,
const String& organizationalUnitName,
const String& commonName) {
int length = 0;
int countryNameLength = countryName.length();
int stateProvinceNameLength = stateProvinceName.length();
int localityNameLength = localityName.length();
int organizationNameLength = organizationName.length();
int organizationalUnitNameLength = organizationalUnitName.length();
int commonNameLength = commonName.length();
if (countryNameLength) {
length += (11 + countryNameLength);
}
if (stateProvinceNameLength) {
length += (11 + stateProvinceNameLength);
}
if (localityNameLength) {
length += (11 + localityNameLength);
}
if (organizationNameLength) {
length += (11 + organizationNameLength);
}
if (organizationalUnitNameLength) {
length += (11 + organizationalUnitNameLength);
}
if (commonNameLength) {
length += (11 + commonNameLength);
}
return length;
}
int ECCX08CertClass::publicKeyLength() {
return (2 + 2 + 9 + 10 + 4 + 64);
}
int ECCX08CertClass::authorityKeyIdentifierLength(const byte authorityKeyIdentifier[]) {
bool set = false;
// check if the authority key identifier is non-zero
for (int i = 0; i < AUTHORITY_KEY_IDENTIFIER_LENGTH; i++) {
if (authorityKeyIdentifier[i] != 0) {
set = true;
break;
}
}
return (set ? 37 : 0);
}
int ECCX08CertClass::signatureLength(const byte signature[]) {
const byte* r = &signature[0];
const byte* s = &signature[32];
int rLength = 32;
int sLength = 32;
while (*r == 0x00 && rLength) {
r++;
rLength--;
}
if (*r & 0x80) {
rLength++;
}
while (*s == 0x00 && sLength) {
s++;
sLength--;
}
if (*s & 0x80) {
sLength++;
}
return (21 + rLength + sLength);
}
int ECCX08CertClass::serialNumberLength(const byte serialNumber[]) {
int length = SERIAL_NUMBER_LENGTH;
while (*serialNumber == 0 && length) {
serialNumber++;
length--;
}
if (*serialNumber & 0x80) {
length++;
}
return (2 + length);
}
int ECCX08CertClass::sequenceHeaderLength(int length) {
if (length > 255) {
return 4;
} else if (length > 127) {
return 3;
} else {
return 2;
}
}
void ECCX08CertClass::appendVersion(int version, byte out[]) {
out[0] = ASN1_INTEGER;
out[1] = 0x01;
out[2] = version;
}
void ECCX08CertClass::appendIssuerOrSubject(const String& countryName,
const String& stateProvinceName,
const String& localityName,
const String& organizationName,
const String& organizationalUnitName,
const String& commonName,
byte out[]) {
if (countryName.length() > 0) {
out += appendName(countryName, 0x06, out);
}
if (stateProvinceName.length() > 0) {
out += appendName(stateProvinceName, 0x08, out);
}
if (localityName.length() > 0) {
out += appendName(localityName, 0x07, out);
}
if (organizationName.length() > 0) {
out += appendName(organizationName, 0x0a, out);
}
if (organizationalUnitName.length() > 0) {
out += appendName(organizationalUnitName, 0x0b, out);
}
if (commonName.length() > 0) {
out += appendName(commonName, 0x03, out);
}
}
void ECCX08CertClass::appendPublicKey(const byte publicKey[], byte out[]) {
int subjectPublicKeyDataLength = 2 + 9 + 10 + 4 + 64;
// subject public key
*out++ = ASN1_SEQUENCE;
*out++ = (subjectPublicKeyDataLength) & 0xff;
*out++ = ASN1_SEQUENCE;
*out++ = 0x13;
// EC public key
*out++ = ASN1_OBJECT_IDENTIFIER;
*out++ = 0x07;
*out++ = 0x2a;
*out++ = 0x86;
*out++ = 0x48;
*out++ = 0xce;
*out++ = 0x3d;
*out++ = 0x02;
*out++ = 0x01;
// PRIME 256 v1
*out++ = ASN1_OBJECT_IDENTIFIER;
*out++ = 0x08;
*out++ = 0x2a;
*out++ = 0x86;
*out++ = 0x48;
*out++ = 0xce;
*out++ = 0x3d;
*out++ = 0x03;
*out++ = 0x01;
*out++ = 0x07;
*out++ = 0x03;
*out++ = 0x42;
*out++ = 0x00;
*out++ = 0x04;
memcpy(out, publicKey, 64);
}
void ECCX08CertClass::appendAuthorityKeyIdentifier(const byte authorityKeyIdentifier[], byte out[]) {
// [3]
*out++ = 0xa3;
*out++ = 0x23;
// sequence
*out++ = ASN1_SEQUENCE;
*out++ = 0x21;
// sequence
*out++ = ASN1_SEQUENCE;
*out++ = 0x1f;
// 2.5.29.35 authorityKeyIdentifier(X.509 extension)
*out++ = 0x06;
*out++ = 0x03;
*out++ = 0x55;
*out++ = 0x1d;
*out++ = 0x23;
// octet string
*out++ = 0x04;
*out++ = 0x18;
// sequence
*out++ = ASN1_SEQUENCE;
*out++ = 0x16;
*out++ = 0x80;
*out++ = 0x14;
memcpy(out, authorityKeyIdentifier, 20);
}
void ECCX08CertClass::appendSignature(const byte signature[], byte out[]) {
// signature algorithm
*out++ = ASN1_SEQUENCE;
*out++ = 0x0a;
*out++ = ASN1_OBJECT_IDENTIFIER;
*out++ = 0x08;
// ECDSA with SHA256
*out++ = 0x2a;
*out++ = 0x86;
*out++ = 0x48;
*out++ = 0xce;
*out++ = 0x3d;
*out++ = 0x04;
*out++ = 0x03;
*out++ = 0x02;
const byte* r = &signature[0];
const byte* s = &signature[32];
int rLength = 32;
int sLength = 32;
while (*r == 0 && rLength) {
r++;
rLength--;
}
while (*s == 0 && sLength) {
s++;
sLength--;
}
if (*r & 0x80) {
rLength++;
}
if (*s & 0x80) {
sLength++;
}
*out++ = ASN1_BIT_STRING;
*out++ = (rLength + sLength + 7);
*out++ = 0;
*out++ = ASN1_SEQUENCE;
*out++ = (rLength + sLength + 4);
*out++ = ASN1_INTEGER;
*out++ = rLength;
if ((*r & 0x80) && rLength) {
*out++ = 0;
rLength--;
}
memcpy(out, r, rLength);
out += rLength;
*out++ = ASN1_INTEGER;
*out++ = sLength;
if ((*s & 0x80) && sLength) {
*out++ = 0;
sLength--;
}
memcpy(out, s, sLength);
out += rLength;
}
void ECCX08CertClass::appendSerialNumber(const byte serialNumber[], byte out[]) {
int length = SERIAL_NUMBER_LENGTH;
while (*serialNumber == 0 && length) {
serialNumber++;
length--;
}
if (*serialNumber & 0x80) {
length++;
}
*out++ = ASN1_INTEGER;
*out++ = length;
if (*serialNumber & 0x80) {
*out++ = 0x00;
length--;
}
memcpy(out, serialNumber, length);
}
int ECCX08CertClass::appendName(const String& name, int type, byte out[]) {
int nameLength = name.length();
*out++ = ASN1_SET;
*out++ = nameLength + 9;
*out++ = ASN1_SEQUENCE;
*out++ = nameLength + 7;
*out++ = ASN1_OBJECT_IDENTIFIER;
*out++ = 0x03;
*out++ = 0x55;
*out++ = 0x04;
*out++ = type;
*out++ = ASN1_PRINTABLE_STRING;
*out++ = nameLength;
memcpy(out, name.c_str(), nameLength);
return (nameLength + 11);
}
void ECCX08CertClass::appendSequenceHeader(int length, byte out[]) {
*out++ = ASN1_SEQUENCE;
if (length > 255) {
*out++ = 0x82;
*out++ = (length >> 8) & 0xff;
} else if (length > 127) {
*out++ = 0x81;
}
*out++ = (length) & 0xff;
}
int ECCX08CertClass::appendDate(int year, int month, int day, int hour, int minute, int second, byte out[]) {
bool useGeneralizedTime = (year > 2049);
if (useGeneralizedTime) {
*out++ = 0x18;
*out++ = 0x0f;
*out++ = '0' + (year / 1000);
*out++ = '0' + ((year % 1000) / 100);
*out++ = '0' + ((year % 100) / 10);
*out++ = '0' + (year % 10);
} else {
year -= 2000;
*out++ = 0x17;
*out++ = 0x0d;
*out++ = '0' + (year / 10);
*out++ = '0' + (year % 10);
}
*out++ = '0' + (month / 10);
*out++ = '0' + (month % 10);
*out++ = '0' + (day / 10);
*out++ = '0' + (day % 10);
*out++ = '0' + (hour / 10);
*out++ = '0' + (hour % 10);
*out++ = '0' + (minute / 10);
*out++ = '0' + (minute % 10);
*out++ = '0' + (second / 10);
*out++ = '0' + (second % 10);
*out++ = 0x5a; // UTC
return (useGeneralizedTime ? 17 : 15);
}
int ECCX08CertClass::appendEcdsaWithSHA256(byte out[]) {
*out++ = ASN1_SEQUENCE;
*out++ = 0x0A;
*out++ = ASN1_OBJECT_IDENTIFIER;
*out++ = 0x08;
*out++ = 0x2A;
*out++ = 0x86;
*out++ = 0x48;
*out++ = 0xCE;
*out++ = 0x3D;
*out++ = 0x04;
*out++ = 0x03;
*out++ = 0x02;
return 12;
}

View file

@ -1,141 +0,0 @@
/*
This file is part of ArduinoIoTCloud.
Copyright 2019 ARDUINO SA (http://www.arduino.cc/)
This software is released under the GNU General Public License version 3,
which covers the main part of arduino-cli.
The terms of this license can be found at:
https://www.gnu.org/licenses/gpl-3.0.en.html
You can be released from the requirements of the above licenses by purchasing
a commercial license. Buying such a license is mandatory if you want to modify or
otherwise use the software for commercial activities involving the Arduino
software without disclosing the source code of your own applications. To purchase
a commercial license, send an email to license@arduino.cc.
*/
#ifndef _ECCX08_CERT_H_
#define _ECCX08_CERT_H_
/******************************************************************************
* INCLUDE
******************************************************************************/
#include <Arduino.h>
/******************************************************************************
* CLASS DECLARATION
******************************************************************************/
class ECCX08CertClass {
public:
ECCX08CertClass();
virtual ~ECCX08CertClass();
int beginCSR(int keySlot, bool newPrivateKey = true);
String endCSR();
int beginStorage(int compressedCertSlot, int serialNumberAndAuthorityKeyIdentifierSlot);
void setSignature(byte signature[]);
void setIssueYear(int issueYear);
void setIssueMonth(int issueMonth);
void setIssueDay(int issueDay);
void setIssueHour(int issueHour);
void setExpireYears(int expireYears);
void setSerialNumber(const byte serialNumber[]);
void setAuthorityKeyIdentifier(const byte authorityKeyIdentifier[]);
int endStorage();
int beginReconstruction(int keySlot, int compressedCertSlot, int serialNumberAndAuthorityKeyIdentifierSlot);
int endReconstruction();
byte* bytes();
int length();
void setIssuerCountryName(const String& countryName);
void setIssuerStateProvinceName(const String& stateProvinceName);
void setIssuerLocalityName(const String& localityName);
void setIssuerOrganizationName(const String& organizationName);
void setIssuerOrganizationalUnitName(const String& organizationalUnitName);
void setIssuerCommonName(const String& commonName);
void setSubjectCountryName(const String& countryName);
void setSubjectStateProvinceName(const String& stateProvinceName);
void setSubjectLocalityName(const String& localityName);
void setSubjectOrganizationName(const String& organizationName);
void setSubjectOrganizationalUnitName(const String& organizationalUnitName);
void setSubjectCommonName(const String& commonName);
private:
int versionLength();
int issuerOrSubjectLength(const String& countryName,
const String& stateProvinceName,
const String& localityName,
const String& organizationName,
const String& organizationalUnitName,
const String& commonName);
int publicKeyLength();
int authorityKeyIdentifierLength(const byte authorityKeyIdentifier[]);
int signatureLength(const byte signature[]);
int serialNumberLength(const byte serialNumber[]);
int sequenceHeaderLength(int length);
void appendVersion(int version, byte out[]);
void appendIssuerOrSubject(const String& countryName,
const String& stateProvinceName,
const String& localityName,
const String& organizationName,
const String& organizationalUnitName,
const String& commonName,
byte out[]);
void appendPublicKey(const byte publicKey[], byte out[]);
void appendAuthorityKeyIdentifier(const byte authorityKeyIdentifier[], byte out[]);
void appendSignature(const byte signature[], byte out[]);
void appendSerialNumber(const byte serialNumber[], byte out[]);
int appendName(const String& name, int type, byte out[]);
void appendSequenceHeader(int length, byte out[]);
int appendDate(int year, int month, int day, int hour, int minute, int second, byte out[]);
int appendEcdsaWithSHA256(byte out[]);
private:
int _keySlot;
int _compressedCertSlot;
int _serialNumberAndAuthorityKeyIdentifierSlot;
String _issuerCountryName;
String _issuerStateProvinceName;
String _issuerLocalityName;
String _issuerOrganizationName;
String _issuerOrganizationalUnitName;
String _issuerCommonName;
String _subjectCountryName;
String _subjectStateProvinceName;
String _subjectLocalityName;
String _subjectOrganizationName;
String _subjectOrganizationalUnitName;
String _subjectCommonName;
byte _temp[108];
byte* _bytes;
int _length;
};
#endif /* _ECCX08_CERT_H_ */

View file

@ -1,49 +0,0 @@
// esp_http_client.c
#include <dirent.h>
#include <sys/stat.h>
#include "esp_log.h"
#include <stdio.h>
#include "esp_http_client.h"
#define MAX_HTTP_RECV_BUFFER 128
static const char* TAG = "HTTP_CLIENT";
int downloadAndSaveFile(char * url, FILE * f, const char * cert_pem)
{
char *buffer = (char*)malloc(MAX_HTTP_RECV_BUFFER);
if (buffer == NULL) {
return -1;
}
esp_http_client_config_t config = {
.url = url,
.cert_pem = cert_pem,
.timeout_ms = 20000,
};
esp_http_client_handle_t client = esp_http_client_init(&config);
esp_err_t err;
if ((err = esp_http_client_open(client, 0)) != ESP_OK) {
ESP_LOGE(TAG, "esp_http_client_open failed: %d", err);
free(buffer);
return -1;
}
int content_length = esp_http_client_fetch_headers(client);
int total_read_len = 0, read_len;
while (total_read_len < content_length) {
read_len = esp_http_client_read(client, buffer, MAX_HTTP_RECV_BUFFER);
fwrite(buffer, sizeof(uint8_t), read_len, f);
if (read_len <= 0) {
break;
}
total_read_len += read_len;
ESP_LOGV(TAG, "esp_http_client_read data received: %d, total %d", read_len, total_read_len);
}
ESP_LOGV(TAG, "connection closed, cleaning up, total %d bytes received", total_read_len);
esp_http_client_close(client);
esp_http_client_cleanup(client);
free(buffer);
return 0;
}

View file

@ -20,20 +20,7 @@
#include <rom/uart.h>
extern "C" {
#include "esp_private/periph_ctrl.h"
#include "soc/gpio_periph.h"
#include "soc/periph_defs.h"
// #include <driver/periph_ctrl.h>
#include <driver/uart.h>
#include <esp_bt.h>
#include "esp_spiffs.h"
#include "esp_log.h"
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
#include "esp_partition.h"
#include <driver/periph_ctrl.h>
}
#include <Arduino.h>
@ -45,57 +32,8 @@ extern "C" {
#define SPI_BUFFER_LEN SPI_MAX_DMA_LEN
// UART debug is enabled on boot
int debug = 1;
int debug = 0;
//--------------------------------------------------------------------
// ADAFRUIT CHANGE
//--------------------------------------------------------------------
// contains SPIS and BT/BLE UART pin definitions
#if !__has_include("board.h")
#error "Board is not supported, please add -DBOARD=<board_name> to the build command"
#endif
#include "board.h"
#define AIRLIFT 1 // Adafruit Airlift
#define NINA_PRINTF(...) do { if (debug) { ets_printf(__VA_ARGS__); } } while (0)
#if defined(CONFIG_IDF_TARGET_ESP32)
extern const struct __sFILE_fake __sf_fake_stdin;
extern const struct __sFILE_fake __sf_fake_stdout;
extern const struct __sFILE_fake __sf_fake_stderr;
// dev, dma, mosi, miso, sclk, cs, ready
SPISClass SPIS(VSPI_HOST, 1, AIRLIFT_MOSI, AIRLIFT_MISO, AIRLIFT_SCK, AIRLIFT_CS, AIRLIFT_BUSY);
#endif
#if defined(CONFIG_IDF_TARGET_ESP32C6)
// UART for BLE HCI
// CONFIG_BT_LE_HCI_UART_RTS_PIN and CONFIG_BT_LE_HCI_UART_CTS_PIN are defined in boards/{BOARD}/sdkconfig
// and used by hci_driver_uart_config() in hci_driver_uart.c. It should matches with BUSY and BOOT pins.
#ifndef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#error "Please Enable Uart for HCI"
#endif
#if CONFIG_BT_LE_HCI_UART_CTS_PIN != 9
#error "CTS pin must be the same as BOOT pin"
#endif
// dev, dma, mosi, miso, sclk, cs, ready
SPISClass SPIS(SPI2_HOST, SPI_DMA_CH_AUTO,
AIRLIFT_MOSI, AIRLIFT_MISO, AIRLIFT_SCK, AIRLIFT_CS, AIRLIFT_BUSY);
#endif
// prevent initArduino() to release BT memory
extern "C" bool btInUse() {
return true;
}
//--------------------------------------------------------------------
//
//--------------------------------------------------------------------
uint8_t* commandBuffer;
uint8_t* responseBuffer;
@ -130,126 +68,31 @@ void setDebug(int d) {
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[1], PIN_FUNC_GPIO);
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[3], PIN_FUNC_GPIO);
#if CONFIG_IDF_TARGET_ESP32
_GLOBAL_REENT->_stdin = (FILE*) &__sf_fake_stdin;
_GLOBAL_REENT->_stdout = (FILE*) &__sf_fake_stdout;
_GLOBAL_REENT->_stderr = (FILE*) &__sf_fake_stderr;
#endif
ets_install_putc1(NULL);
ets_install_putc2(NULL);
}
}
void setupWiFi();
void setupBluetooth();
void setup() {
#ifndef CMAKE_BUILD_TYPE_DEBUG
setDebug(0);
#endif
setDebug(debug);
#if !AIRLIFT
// put SWD and SWCLK pins connected to SAMD as inputs
pinMode(15, INPUT);
pinMode(21, INPUT);
#endif
pinMode(AIRLIFT_CS, INPUT);
if (digitalRead(AIRLIFT_CS) == LOW) {
setupBluetooth();
} else {
setupWiFi();
}
}
// #define UNO_WIFI_REV2
void setupBluetooth() {
NINA_PRINTF("*** BLUETOOTH\n");
periph_module_enable(PERIPH_UART1_MODULE);
periph_module_enable(PERIPH_UHCI0_MODULE);
esp_bt_controller_config_t btControllerConfig = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
#if defined(CONFIG_IDF_TARGET_ESP32)
#if defined(AIRLIFT)
// TX GPIO1 & RX GPIO3 on ESP32 'hardware' UART
// RTS on ESP_BUSY (GPIO33)
// CTS on GPIO0 (GPIO0)
uart_set_pin(UART_NUM_1, 1, 3, AIRLIFT_RTS, AIRLIFT_CTS);
#elif defined(UNO_WIFI_REV2)
uart_set_pin(UART_NUM_1, 1, 3, 33, 0); // TX, RX, RTS, CTS
#elif defined(NANO_RP2040_CONNECT)
uart_set_pin(UART_NUM_1, 1, 3, 33, 12); // TX, RX, RTS, CTS
#else
uart_set_pin(UART_NUM_1, 23, 12, 18, 5);
#endif
uart_set_hw_flow_ctrl(UART_NUM_1, UART_HW_FLOWCTRL_CTS_RTS, 5);
btControllerConfig.hci_uart_no = UART_NUM_1;
#if defined(AIRLIFT)
btControllerConfig.hci_uart_baudrate = 115200;
#elif defined(UNO_WIFI_REV2) || defined(NANO_RP2040_CONNECT)
btControllerConfig.hci_uart_baudrate = 115200;
#else
btControllerConfig.hci_uart_baudrate = 912600;
#endif
#elif defined(CONFIG_IDF_TARGET_ESP32C6)
// UART is configured by CONFIG_BT_LE_HCI_UART_XYZ in sdkconfig.defaults.esp32c6
#endif
esp_err_t ret = esp_bt_controller_init(&btControllerConfig);
if (ESP_OK != ret) {
setDebug(1);
NINA_PRINTF("esp_bt_controller_init failed: 0x%x\n", ret);
while (1) {}
}
while (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE);
esp_bt_controller_enable(ESP_BT_MODE_BLE);
#if defined(CONFIG_IDF_TARGET_ESP32)
esp_bt_sleep_enable();
#endif
vTaskSuspend(NULL);
while (1) {
vTaskDelay(portMAX_DELAY);
}
}
void setupWiFi() {
NINA_PRINTF("WIFI ON\n");
esp_bt_controller_mem_release(ESP_BT_MODE_BTDM);
SPIS.begin();
esp_vfs_spiffs_conf_t conf = {
.base_path = "/fs",
.partition_label = "storage",
.max_files = 20,
.format_if_mount_failed = true
};
esp_err_t ret = esp_vfs_spiffs_register(&conf);
(void) ret;
if (WiFi.status() == WL_NO_SHIELD) {
if (!debug) {
setDebug(1);
}
NINA_PRINTF("*** NOSHIELD\n");
while (1); // no shield
}
commandBuffer = (uint8_t*)heap_caps_malloc(SPI_BUFFER_LEN, MALLOC_CAP_DMA);
responseBuffer = (uint8_t*)heap_caps_malloc(SPI_BUFFER_LEN, MALLOC_CAP_DMA);
NINA_PRINTF("*** CommandHandler Begin\n");
CommandHandler.begin();
}

View file

@ -4,4 +4,3 @@ nvs, data, nvs, 0x9000, 0x6000
phy_init, data, phy, 0xf000, 0x1000
certs, data, 0x04, 0x10000, 0x20000
factory, app, factory, 0x30000, 0x180000
storage, data, spiffs, 0x1B0000,0x40000

1 # Name, Type, SubType, Offset, Size
4 phy_init, data, phy, 0xf000, 0x1000
5 certs, data, 0x04, 0x10000, 0x20000
6 factory, app, factory, 0x30000, 0x180000
storage, data, spiffs, 0x1B0000,0x40000

570
sdkconfig Normal file
View file

@ -0,0 +1,570 @@
#
# Automatically generated file; DO NOT EDIT.
# Espressif IoT Development Framework Configuration
#
#
# SDK tool configuration
#
CONFIG_TOOLPREFIX="xtensa-esp32-elf-"
CONFIG_PYTHON="python"
CONFIG_MAKE_WARN_UNDEFINED_VARIABLES=y
#
# Bootloader config
#
CONFIG_LOG_BOOTLOADER_LEVEL_NONE=y
CONFIG_LOG_BOOTLOADER_LEVEL_ERROR=
CONFIG_LOG_BOOTLOADER_LEVEL_WARN=
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=
CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG=
CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE=
CONFIG_LOG_BOOTLOADER_LEVEL=0
CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V=
CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y
CONFIG_BOOTLOADER_FACTORY_RESET=
CONFIG_BOOTLOADER_APP_TEST=
#
# Security features
#
CONFIG_SECURE_BOOT_ENABLED=
CONFIG_FLASH_ENCRYPTION_ENABLED=
#
# Serial flasher config
#
CONFIG_ESPTOOLPY_PORT="/dev/ttyUSB0"
CONFIG_ESPTOOLPY_BAUD_115200B=y
CONFIG_ESPTOOLPY_BAUD_230400B=
CONFIG_ESPTOOLPY_BAUD_921600B=
CONFIG_ESPTOOLPY_BAUD_2MB=
CONFIG_ESPTOOLPY_BAUD_OTHER=
CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200
CONFIG_ESPTOOLPY_BAUD=115200
CONFIG_ESPTOOLPY_COMPRESSED=y
CONFIG_FLASHMODE_QIO=
CONFIG_FLASHMODE_QOUT=
CONFIG_FLASHMODE_DIO=y
CONFIG_FLASHMODE_DOUT=
CONFIG_ESPTOOLPY_FLASHMODE="dio"
CONFIG_ESPTOOLPY_FLASHFREQ_80M=
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
CONFIG_ESPTOOLPY_FLASHFREQ_26M=
CONFIG_ESPTOOLPY_FLASHFREQ_20M=
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
CONFIG_ESPTOOLPY_FLASHSIZE_1MB=
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=
CONFIG_ESPTOOLPY_FLASHSIZE="2MB"
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
CONFIG_ESPTOOLPY_BEFORE_RESET=y
CONFIG_ESPTOOLPY_BEFORE_NORESET=
CONFIG_ESPTOOLPY_BEFORE="default_reset"
CONFIG_ESPTOOLPY_AFTER_RESET=y
CONFIG_ESPTOOLPY_AFTER_NORESET=
CONFIG_ESPTOOLPY_AFTER="hard_reset"
CONFIG_MONITOR_BAUD_9600B=
CONFIG_MONITOR_BAUD_57600B=
CONFIG_MONITOR_BAUD_115200B=y
CONFIG_MONITOR_BAUD_230400B=
CONFIG_MONITOR_BAUD_921600B=
CONFIG_MONITOR_BAUD_2MB=
CONFIG_MONITOR_BAUD_OTHER=
CONFIG_MONITOR_BAUD_OTHER_VAL=115200
CONFIG_MONITOR_BAUD=115200
#
# Partition Table
#
CONFIG_PARTITION_TABLE_SINGLE_APP=
CONFIG_PARTITION_TABLE_TWO_OTA=
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y
#
# Compiler options
#
CONFIG_OPTIMIZATION_LEVEL_DEBUG=y
CONFIG_OPTIMIZATION_LEVEL_RELEASE=
CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y
CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=
CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED=
CONFIG_CXX_EXCEPTIONS=
CONFIG_STACK_CHECK_NONE=y
CONFIG_STACK_CHECK_NORM=
CONFIG_STACK_CHECK_STRONG=
CONFIG_STACK_CHECK_ALL=
CONFIG_STACK_CHECK=
CONFIG_WARN_WRITE_STRINGS=
#
# Component config
#
#
# Application Level Tracing
#
CONFIG_ESP32_APPTRACE_DEST_TRAX=
CONFIG_ESP32_APPTRACE_DEST_NONE=y
CONFIG_ESP32_APPTRACE_ENABLE=
CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y
CONFIG_AWS_IOT_SDK=
#
# Bluetooth
#
CONFIG_BT_ENABLED=
CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0
CONFIG_BT_RESERVE_DRAM=0
#
# Driver configurations
#
#
# ADC configuration
#
CONFIG_ADC_FORCE_XPD_FSM=
CONFIG_ADC2_DISABLE_DAC=y
#
# SPI master configuration
#
CONFIG_SPI_MASTER_IN_IRAM=y
CONFIG_SPI_MASTER_ISR_IN_IRAM=y
#
# ESP32-specific
#
CONFIG_ESP32_DEFAULT_CPU_FREQ_80=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_160=
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=80
CONFIG_SPIRAM_SUPPORT=
CONFIG_MEMMAP_TRACEMEM=
CONFIG_MEMMAP_TRACEMEM_TWOBANKS=
CONFIG_ESP32_TRAX=
CONFIG_TRACEMEM_RESERVE_DRAM=0x0
CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH=
CONFIG_ESP32_ENABLE_COREDUMP_TO_UART=
CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y
CONFIG_ESP32_ENABLE_COREDUMP=
CONFIG_TWO_UNIVERSAL_MAC_ADDRESS=
CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y
CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4
CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32
CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2048
CONFIG_MAIN_TASK_STACK_SIZE=3584
CONFIG_IPC_TASK_STACK_SIZE=1024
CONFIG_TIMER_TASK_STACK_SIZE=3584
CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y
CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF=
CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR=
CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF=
CONFIG_NEWLIB_STDIN_LINE_ENDING_LF=
CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
CONFIG_NEWLIB_NANO_FORMAT=
CONFIG_CONSOLE_UART_DEFAULT=
CONFIG_CONSOLE_UART_CUSTOM=
CONFIG_CONSOLE_UART_NONE=y
CONFIG_CONSOLE_UART_NUM=0
CONFIG_ULP_COPROC_ENABLED=
CONFIG_ULP_COPROC_RESERVE_MEM=0
CONFIG_ESP32_PANIC_PRINT_HALT=
CONFIG_ESP32_PANIC_PRINT_REBOOT=y
CONFIG_ESP32_PANIC_SILENT_REBOOT=
CONFIG_ESP32_PANIC_GDBSTUB=
CONFIG_ESP32_DEBUG_OCDAWARE=y
CONFIG_ESP32_DEBUG_STUBS_ENABLE=
CONFIG_INT_WDT=y
CONFIG_INT_WDT_TIMEOUT_MS=300
CONFIG_INT_WDT_CHECK_CPU1=y
CONFIG_TASK_WDT=y
CONFIG_TASK_WDT_PANIC=
CONFIG_TASK_WDT_TIMEOUT_S=5
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y
CONFIG_BROWNOUT_DET=y
CONFIG_BROWNOUT_DET_LVL_SEL_0=y
CONFIG_BROWNOUT_DET_LVL_SEL_1=
CONFIG_BROWNOUT_DET_LVL_SEL_2=
CONFIG_BROWNOUT_DET_LVL_SEL_3=
CONFIG_BROWNOUT_DET_LVL_SEL_4=
CONFIG_BROWNOUT_DET_LVL_SEL_5=
CONFIG_BROWNOUT_DET_LVL_SEL_6=
CONFIG_BROWNOUT_DET_LVL_SEL_7=
CONFIG_BROWNOUT_DET_LVL=0
CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y
CONFIG_ESP32_TIME_SYSCALL_USE_RTC=
CONFIG_ESP32_TIME_SYSCALL_USE_FRC1=
CONFIG_ESP32_TIME_SYSCALL_USE_NONE=
CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y
CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL=
CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024
CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000
CONFIG_ESP32_XTAL_FREQ_40=y
CONFIG_ESP32_XTAL_FREQ_26=
CONFIG_ESP32_XTAL_FREQ_AUTO=
CONFIG_ESP32_XTAL_FREQ=40
CONFIG_DISABLE_BASIC_ROM_CONSOLE=
CONFIG_NO_BLOBS=
CONFIG_ESP_TIMER_PROFILING=
CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS=
CONFIG_ESP_ERR_TO_NAME_LOOKUP=y
#
# Wi-Fi
#
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_CSI_ENABLED=y
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y
CONFIG_ESP32_WIFI_TX_BA_WIN=6
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP32_WIFI_RX_BA_WIN=6
CONFIG_ESP32_WIFI_NVS_ENABLED=y
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1=
#
# PHY
#
CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y
CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION=
CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20
CONFIG_ESP32_PHY_MAX_TX_POWER=20
#
# Power Management
#
CONFIG_PM_ENABLE=
#
# ADC-Calibration
#
CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y
CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y
CONFIG_ADC_CAL_LUT_ENABLE=y
#
# ESP HTTP client
#
CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y
#
# Ethernet
#
CONFIG_DMA_RX_BUF_NUM=10
CONFIG_DMA_TX_BUF_NUM=10
CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE=
CONFIG_EMAC_TASK_PRIORITY=20
#
# FAT Filesystem support
#
CONFIG_FATFS_CODEPAGE_DYNAMIC=
CONFIG_FATFS_CODEPAGE_437=y
CONFIG_FATFS_CODEPAGE_720=
CONFIG_FATFS_CODEPAGE_737=
CONFIG_FATFS_CODEPAGE_771=
CONFIG_FATFS_CODEPAGE_775=
CONFIG_FATFS_CODEPAGE_850=
CONFIG_FATFS_CODEPAGE_852=
CONFIG_FATFS_CODEPAGE_855=
CONFIG_FATFS_CODEPAGE_857=
CONFIG_FATFS_CODEPAGE_860=
CONFIG_FATFS_CODEPAGE_861=
CONFIG_FATFS_CODEPAGE_862=
CONFIG_FATFS_CODEPAGE_863=
CONFIG_FATFS_CODEPAGE_864=
CONFIG_FATFS_CODEPAGE_865=
CONFIG_FATFS_CODEPAGE_866=
CONFIG_FATFS_CODEPAGE_869=
CONFIG_FATFS_CODEPAGE_932=
CONFIG_FATFS_CODEPAGE_936=
CONFIG_FATFS_CODEPAGE_949=
CONFIG_FATFS_CODEPAGE_950=
CONFIG_FATFS_CODEPAGE=437
CONFIG_FATFS_LFN_NONE=y
CONFIG_FATFS_LFN_HEAP=
CONFIG_FATFS_LFN_STACK=
CONFIG_FATFS_FS_LOCK=0
CONFIG_FATFS_TIMEOUT_MS=10000
CONFIG_FATFS_PER_FILE_CACHE=y
#
# FreeRTOS
#
CONFIG_FREERTOS_UNICORE=
CONFIG_FREERTOS_CORETIMER_0=y
CONFIG_FREERTOS_CORETIMER_1=
CONFIG_FREERTOS_HZ=100
CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE=
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL=
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=
CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y
CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1
CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y
CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE=
CONFIG_FREERTOS_ASSERT_DISABLE=
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1024
CONFIG_FREERTOS_ISR_STACKSIZE=1536
CONFIG_FREERTOS_LEGACY_HOOKS=
CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16
CONFIG_SUPPORT_STATIC_ALLOCATION=
CONFIG_TIMER_TASK_PRIORITY=1
CONFIG_TIMER_TASK_STACK_DEPTH=2048
CONFIG_TIMER_QUEUE_LENGTH=10
CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0
CONFIG_FREERTOS_USE_TRACE_FACILITY=
CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=
CONFIG_FREERTOS_DEBUG_INTERNALS=
#
# Heap memory debugging
#
CONFIG_HEAP_POISONING_DISABLED=y
CONFIG_HEAP_POISONING_LIGHT=
CONFIG_HEAP_POISONING_COMPREHENSIVE=
CONFIG_HEAP_TRACING=
#
# libsodium
#
CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y
#
# Log output
#
CONFIG_LOG_DEFAULT_LEVEL_NONE=
CONFIG_LOG_DEFAULT_LEVEL_ERROR=
CONFIG_LOG_DEFAULT_LEVEL_WARN=
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_LOG_COLORS=y
#
# LWIP
#
CONFIG_L2_TO_L3_COPY=
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_MAX_SOCKETS=10
CONFIG_USE_ONLY_LWIP_SELECT=
CONFIG_LWIP_SO_REUSE=y
CONFIG_LWIP_SO_REUSE_RXTOALL=y
CONFIG_LWIP_SO_RCVBUF=y
CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1
CONFIG_LWIP_IP_FRAG=
CONFIG_LWIP_IP_REASSEMBLY=
CONFIG_LWIP_STATS=y
CONFIG_LWIP_ETHARP_TRUST_IP_MAC=y
CONFIG_TCPIP_RECVMBOX_SIZE=32
CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
#
# DHCP server
#
CONFIG_LWIP_DHCPS_LEASE_UNIT=60
CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8
CONFIG_LWIP_AUTOIP=
CONFIG_LWIP_NETIF_LOOPBACK=y
CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8
#
# TCP
#
CONFIG_LWIP_MAX_ACTIVE_TCP=16
CONFIG_LWIP_MAX_LISTENING_TCP=16
CONFIG_TCP_MAXRTX=12
CONFIG_TCP_SYNMAXRTX=6
CONFIG_TCP_MSS=1436
CONFIG_TCP_MSL=60000
CONFIG_TCP_SND_BUF_DEFAULT=5744
CONFIG_TCP_WND_DEFAULT=5744
CONFIG_TCP_RECVMBOX_SIZE=6
CONFIG_TCP_QUEUE_OOSEQ=y
CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES=y
CONFIG_TCP_OVERSIZE_MSS=y
CONFIG_TCP_OVERSIZE_QUARTER_MSS=
CONFIG_TCP_OVERSIZE_DISABLE=
#
# UDP
#
CONFIG_LWIP_MAX_UDP_PCBS=16
CONFIG_UDP_RECVMBOX_SIZE=6
CONFIG_TCPIP_TASK_STACK_SIZE=2048
CONFIG_PPP_SUPPORT=
#
# ICMP
#
CONFIG_LWIP_MULTICAST_PING=
CONFIG_LWIP_BROADCAST_PING=
#
# LWIP RAW API
#
CONFIG_LWIP_MAX_RAW_PCBS=16
#
# mbedTLS
#
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=16384
CONFIG_MBEDTLS_DEBUG=
CONFIG_MBEDTLS_HARDWARE_AES=y
CONFIG_MBEDTLS_HARDWARE_MPI=
CONFIG_MBEDTLS_HARDWARE_SHA=
CONFIG_MBEDTLS_HAVE_TIME=y
CONFIG_MBEDTLS_HAVE_TIME_DATE=
CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y
CONFIG_MBEDTLS_TLS_SERVER_ONLY=
CONFIG_MBEDTLS_TLS_CLIENT_ONLY=
CONFIG_MBEDTLS_TLS_DISABLED=
CONFIG_MBEDTLS_TLS_SERVER=y
CONFIG_MBEDTLS_TLS_CLIENT=y
CONFIG_MBEDTLS_TLS_ENABLED=y
#
# TLS Key Exchange Methods
#
CONFIG_MBEDTLS_PSK_MODES=
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y
CONFIG_MBEDTLS_SSL_RENEGOTIATION=y
CONFIG_MBEDTLS_SSL_PROTO_SSL3=
CONFIG_MBEDTLS_SSL_PROTO_TLS1=y
CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
CONFIG_MBEDTLS_SSL_PROTO_DTLS=
CONFIG_MBEDTLS_SSL_ALPN=y
CONFIG_MBEDTLS_SSL_SESSION_TICKETS=y
#
# Symmetric Ciphers
#
CONFIG_MBEDTLS_AES_C=y
CONFIG_MBEDTLS_CAMELLIA_C=
CONFIG_MBEDTLS_DES_C=
CONFIG_MBEDTLS_RC4_DISABLED=y
CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT=
CONFIG_MBEDTLS_RC4_ENABLED=
CONFIG_MBEDTLS_BLOWFISH_C=
CONFIG_MBEDTLS_XTEA_C=
CONFIG_MBEDTLS_CCM_C=y
CONFIG_MBEDTLS_GCM_C=y
CONFIG_MBEDTLS_RIPEMD160_C=
#
# Certificates
#
CONFIG_MBEDTLS_PEM_PARSE_C=y
CONFIG_MBEDTLS_PEM_WRITE_C=y
CONFIG_MBEDTLS_X509_CRL_PARSE_C=y
CONFIG_MBEDTLS_X509_CSR_PARSE_C=y
CONFIG_MBEDTLS_ECP_C=y
CONFIG_MBEDTLS_ECDH_C=y
CONFIG_MBEDTLS_ECDSA_C=y
CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y
CONFIG_MBEDTLS_ECP_NIST_OPTIM=y
#
# OpenSSL
#
CONFIG_OPENSSL_DEBUG=
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
CONFIG_OPENSSL_ASSERT_EXIT=
#
# PThreads
#
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
#
# SPI Flash driver
#
CONFIG_SPI_FLASH_VERIFY_WRITE=
CONFIG_SPI_FLASH_ENABLE_COUNTERS=
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS=
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED=
#
# SPIFFS Configuration
#
CONFIG_SPIFFS_MAX_PARTITIONS=3
#
# SPIFFS Cache Configuration
#
CONFIG_SPIFFS_CACHE=y
CONFIG_SPIFFS_CACHE_WR=y
CONFIG_SPIFFS_CACHE_STATS=
CONFIG_SPIFFS_PAGE_CHECK=y
CONFIG_SPIFFS_GC_MAX_RUNS=10
CONFIG_SPIFFS_GC_STATS=
CONFIG_SPIFFS_PAGE_SIZE=256
CONFIG_SPIFFS_OBJ_NAME_LEN=32
CONFIG_SPIFFS_USE_MAGIC=y
CONFIG_SPIFFS_USE_MAGIC_LENGTH=y
CONFIG_SPIFFS_META_LENGTH=4
CONFIG_SPIFFS_USE_MTIME=y
#
# Debug Configuration
#
CONFIG_SPIFFS_DBG=
CONFIG_SPIFFS_API_DBG=
CONFIG_SPIFFS_GC_DBG=
CONFIG_SPIFFS_CACHE_DBG=
CONFIG_SPIFFS_CHECK_DBG=
CONFIG_SPIFFS_TEST_VISUALISATION=
#
# tcpip adapter
#
CONFIG_IP_LOST_TIMER_INTERVAL=120
#
# Virtual file system
#
CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y
#
# Wear Levelling
#
CONFIG_WL_SECTOR_SIZE_512=
CONFIG_WL_SECTOR_SIZE_4096=y
CONFIG_WL_SECTOR_SIZE=4096

View file

@ -1 +0,0 @@
CONFIG_LOG_DEFAULT_LEVEL_INFO=y

View file

@ -1,29 +0,0 @@
# This file was generated using idf.py save-defconfig. It can be edited manually.
# Espressif IoT Development Framework (ESP-IDF) 5.3.1 Project Minimal Configuration
#
CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y
CONFIG_APP_EXCLUDE_PROJECT_VER_VAR=y
CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_AUTOSTART_ARDUINO=y
CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_WARN=y
CONFIG_ARDUHAL_ESP_LOG=y
CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y
CONFIG_BT_ENABLED=y
CONFIG_BT_CONTROLLER_ONLY=y
CONFIG_ESP_PHY_REDUCE_TX_POWER=y
CONFIG_ESP_WIFI_CSI_ENABLED=y
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
CONFIG_LOG_DEFAULT_LEVEL_WARN=y
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_MAX_SOCKETS=6
CONFIG_LWIP_TCP_SYNMAXRTX=6
# CONFIG_LWIP_TCP_MSS=1436
# CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744
# CONFIG_LWIP_TCP_WND_DEFAULT=5744
# CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=4096
CONFIG_MBEDTLS_PSK_MODES=y
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK=y

View file

@ -1,29 +0,0 @@
#!/usr/bin/env python3
"""Simple script that translates "Backtrace:" lines from the ESP output to files
and line numbers.
Run with: python3 tools/decode_backtrace.py <board>
Enter the backtrace line at the "? " prompt. CTRL-C to exit the script.
"""
import subprocess
import sys
while True:
addresses = input("? ")
if addresses.startswith("Backtrace:"):
addresses = addresses[len("Backtrace:") :]
if addresses.startswith("Stack memory:"):
addresses = addresses[len("Stack memory:") :]
addresses = addresses.strip().split()
addresses = [address.split(":")[0] for address in addresses]
for address in addresses:
result = subprocess.run(
["xtensa-esp32s2-elf-addr2line", "-aipfe", "build/nina-fw.elf"]
+ [address],
capture_output=True,
)
stdout = result.stdout.decode("utf-8")
if "?? ??" not in stdout:
print(stdout.strip())

View file

@ -1,101 +0,0 @@
#!/bin/bash
echo '' > roots.pem
for filename in *.0
do
is_amazon=$(openssl x509 -in $filename -text -nocert | grep "O = Amazon")
is_google=$(openssl x509 -in $filename -text -nocert | grep "O = Google Trust Services LLC")
is_comodo=$(openssl x509 -in $filename -text -nocert | grep "O = Comodo CA Limited")
is_comodo_uppercase=$(openssl x509 -in $filename -text -nocert | grep "O = COMODO CA Limited")
is_digicert=$(openssl x509 -in $filename -text -nocert | grep "O = DigiCert")
is_isrg=$(openssl x509 -in $filename -text -nocert | grep "O = Internet Security Research Group")
is_verisign=$(openssl x509 -in $filename -text -nocert | grep "O = \"VeriSign, Inc.\"")
is_baltimore=$(openssl x509 -in $filename -text -nocert | grep "O = Baltimore")
is_globalsign=$(openssl x509 -in $filename -text -nocert | grep "O = GlobalSign")
is_starfield=$(openssl x509 -in $filename -text -nocert | grep "O = \"Starfield Technologies, Inc.\"")
is_dst=$(openssl x509 -in $filename -text -nocert | grep "O = Digital Signature Trust Co.")
is_cybertrust=$(openssl x509 -in $filename -text -nocert | grep "O = \"Cybertrust, Inc\"")
is_usertrust=$(openssl x509 -in $filename -text -nocert | grep "O = The USERTRUST Network")
openssl_opts="-text -certopt no_header,no_pubkey,no_subject,no_issuer,no_signame,no_version,no_serial,no_validity,no_extensions,no_sigdump,no_aux,no_extensions"
if [ ! -z "$is_amazon" ]
then
echo $is_amazon
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_google" ]
then
echo $is_google
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_comodo_uppercase" ]
then
echo $is_comodo_uppercase
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_comodo" ]
then
echo $is_comodo
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_digicert" ]
then
echo $is_digicert
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_isrg" ]
then
echo $is_isrg
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_verisign" ]
then
echo $is_verisign
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_baltimore" ]
then
echo $is_baltimore
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_globalsign" ]
then
echo $is_globalsign
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_starfield" ]
then
echo $is_starfield
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_dst" ]
then
echo $is_dst
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_cybertrust" ]
then
echo $is_cybertrust
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
if [ ! -z "$is_usertrust" ]
then
echo $is_usertrust
openssl x509 -in $filename $openssl_opts >> roots.pem
fi
done

View file

@ -1,54 +0,0 @@
#!/bin/bash
while getopts "c:l:e" opt;do
case $opt in
c ) export CER_FILE="$OPTARG";;
l ) export URL_LIST="$OPTARG";;
e ) export SHOW_ERR=1;;
* )
echo "Unknown parameter."
exit 1
;;
esac
done
if [ $# -eq 0 ] ; then
echo "Usage: $(basename $0) [-c /path/to/certificate/file.pem] [-l path/to/url/list.txt]"
echo
echo " -c specify certificate file to test"
echo " -l specify url list"
echo " -e show curl errors in log"
echo
echo "Example:"
echo " $(basename $0) -c roots.pem -l url_list.txt"
exit 0
fi
export SHOW_ERR=${SHOW_ERR:-0}
echo
echo SHOW_ERR=$SHOW_ERR
echo
for i in $(cat $URL_LIST)
do
echo -n "$i "
# -s: silent
# -S: show error
# -m: max time
# --cacert: path to certificate pem file
# --capath: local certificate path
# --output: stdout output
if [ "$SHOW_ERR" -eq 1 ] ; then
m=$(curl "$i" -s -S -m 60 --cacert $CER_FILE --capath /dev/null --output /dev/null --stderr -)
else
curl "$i" -s -m 60 --cacert $CER_FILE --capath /dev/null --output /dev/null
fi
#curl --cacert roots.pem --trace-ascii log.log -K url_list.txt
if [ $? -eq 0 ] ; then
echo -e "\e[32m PASS \e[39m"
else
echo -n -e "\e[31m FAIL \e[39m"
echo $m
fi
done

View file

@ -1,503 +0,0 @@
SHOW_ERR=1
https://google.com  PASS 
https://apple.co  PASS 
https://youtube.co  PASS 
https://play.google.com  PASS 
https://support.google.com  PASS 
https://cloudflare.com  PASS 
https://blogger.com  PASS 
https://microsoft.com  PASS 
https://linkedin.com  PASS 
https://docs.google.com  PASS 
https://youtu.be  PASS 
https://wordpress.org  PASS 
https://maps.google.com  PASS 
https://en.wikipedia.org  PASS 
https://mozilla.org  PASS 
https://accounts.google.com  PASS 
https://googleusercontent.com  FAIL curl: (6) Could not resolve host: googleusercontent.com
https://europa.eu  PASS 
https://sites.google.com  PASS 
https://drive.google.com  PASS 
https://vimeo.com  PASS 
https://adobe.com  PASS 
https://plus.google.com  PASS 
https://es.wikipedia.org  PASS 
https://pt.wikipedia.org  PASS 
https://uol.com.br  PASS 
https://bbc.co.uk  PASS 
https://amazon.com  PASS 
https://cnn.com  PASS 
https://bp.blogspot.com  FAIL curl: (6) Could not resolve host: bp.blogspot.com
https://facebook.com  PASS 
https://vk.com  PASS 
https://istockphoto.com  PASS 
https://github.com  PASS 
https://line.me  PASS 
https://www.yahoo.com  PASS 
https://wikimedia.org  PASS 
https://forbes.com  PASS 
https://opera.com  PASS 
https://creativecommons.org  PASS 
https://brandbucket.com  PASS 
https://imdb.com  PASS 
https://google.de  PASS 
https://dropbox.com  PASS 
https://google.co.jp  PASS 
https://live.com  PASS 
https://bbc.com  PASS 
https://myspace.com  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://mail.ru  PASS 
https://reuters.com  PASS 
https://jimdofree.com  PASS 
https://theguardian.com  PASS 
https://google.es  PASS 
https://medium.com  PASS 
https://news.google.com  PASS 
https://dailymotion.com  PASS 
https://mail.google.com  PASS 
https://www.weebly.com  PASS 
https://w3.org  PASS 
https://t.me  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://feedburner.com  PASS 
https://whatsapp.com  PASS 
https://issuu.com  PASS 
https://fr.wikipedia.org  PASS 
https://policies.google.com  PASS 
https://hugedomains.com  PASS 
https://abril.com.br  PASS 
https://developers.google.com  PASS 
https://globo.com  PASS 
https://google.com.br  PASS 
https://nih.gov  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://slideshare.net  PASS 
https://nytimes.com  PASS 
https://gstatic.com  PASS 
https://msn.com  PASS 
https://paypal.com  PASS 
https://get.google.com  PASS 
https://www.gov.uk  PASS 
https://who.int  PASS 
https://latimes.com  PASS 
https://steampowered.com  PASS 
https://bit.ly  PASS 
https://cdc.gov  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://news.yahoo.com  PASS 
https://wikia.com  PASS 
https://apache.org  PASS 
https://nasa.gov  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://twitter.com  PASS 
https://un.org  PASS 
https://books.google.com  PASS 
https://aboutads.info  PASS 
https://time.com  PASS 
https://draft.blogger.com  PASS 
https://change.org  PASS 
https://fandom.com  PASS 
https://google.it  PASS 
https://rakuten.co.jp  PASS 
https://tools.google.com  PASS 
https://buydomains.com  PASS 
https://webmd.com  PASS 
https://myaccount.google.com  PASS 
https://dailymail.co.uk  PASS 
https://translate.google.com  PASS 
https://independent.co.uk  PASS 
https://google.co.uk  PASS 
https://networkadvertising.org  PASS 
https://booking.com  PASS 
https://thesun.co.uk  PASS 
https://hatena.ne.jp  PASS 
https://cpanel.com  PASS 
https://pinterest.com  PASS 
https://ebay.com  PASS 
https://cpanel.net  PASS 
https://archive.org  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://telegraph.co.uk  PASS 
https://gravatar.com  PASS 
https://marketingplatform.google.com  PASS 
https://washingtonpost.com  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://de.wikipedia.org  PASS 
https://plesk.com  PASS 
https://wired.com  PASS 
https://namecheap.com  PASS 
https://search.google.com  PASS 
https://fb.com  PASS 
https://files.wordpress.com  PASS 
https://mediafire.com  PASS 
https://dan.com  PASS 
https://google.pl  PASS 
https://android.com  PASS 
https://aol.com  PASS 
https://telegram.me  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://picasaweb.google.com  PASS 
https://abcnews.go.com  PASS 
https://wsj.com  PASS 
https://it.wikipedia.org  PASS 
https://scribd.com  PASS 
https://usatoday.com  PASS 
https://google.fr  PASS 
https://youronlinechoices.com  PASS 
https://lefigaro.fr  PASS 
https://goo.gl  PASS 
https://samsung.com  PASS 
https://terra.com.br  PASS 
https://amazon.co.jp  PASS 
https://id.wikipedia.org  PASS 
https://huffingtonpost.com  PASS 
https://cnet.com  PASS 
https://huffpost.com  PASS 
https://ig.com.br  FAIL curl: (7) Failed to connect to ig.com.br port 443: Connection timed out
https://office.com  PASS 
https://businessinsider.com  PASS 
https://4shared.com  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://wa.me  PASS 
https://amazon.co.uk  PASS 
https://bloomberg.com  PASS 
https://ok.ru  PASS 
https://amazon.de  PASS 
https://harvard.edu  PASS 
https://foxnews.com  PASS 
https://photos.google.com  PASS 
https://aliexpress.com  PASS 
https://elpais.com  PASS 
https://google.ru  PASS 
https://tinyurl.com  PASS 
https://academia.edu  PASS 
https://twitch.tv  PASS 
https://surveymonkey.com  PASS 
https://rambler.ru  PASS 
https://stanford.edu  PASS 
https://wikihow.com  PASS 
https://eventbrite.com  PASS 
https://disney.com  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://wiley.com  PASS 
https://welt.de  PASS 
https://indiatimes.com  PASS 
https://pl.wikipedia.org  PASS 
https://nginx.com  PASS 
https://cbc.ca  PASS 
https://spotify.com  PASS 
https://xbox.com  PASS 
https://icann.org  PASS 
https://repubblica.it  PASS 
https://arxiv.org  PASS 
https://alibaba.com  PASS 
https://mega.nz  PASS 
https://usnews.com  FAIL curl: (28) Operation timed out after 60001 milliseconds with 0 bytes received
https://enable-javascript.com  PASS 
https://ziddu.com  PASS 
https://picasa.google.com  PASS 
https://lemonde.fr  PASS 
https://themeforest.net  PASS 
https://imageshack.com  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://sedo.com  PASS 
https://sciencedaily.com  PASS 
https://sputniknews.com  PASS 
https://netflix.com  PASS 
https://storage.googleapis.com  PASS 
https://theatlantic.com  PASS 
https://imageshack.us  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://goodreads.com  PASS 
https://php.net  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://loc.gov  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://disqus.com  PASS 
https://news.com.au  PASS 
https://photobucket.com  PASS 
https://lycos.com  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://qq.com  PASS 
https://forms.gle  PASS 
https://ikea.com  FAIL curl: (28) Connection timed out after 60001 milliseconds
https://ea.com  PASS 
https://cambridge.org  FAIL curl: (28) Connection timed out after 60000 milliseconds
https://trustpilot.com  PASS 
https://biglobe.ne.jp  PASS 
https://clickbank.net  FAIL curl: (6) Could not resolve host: clickbank.net
https://allaboutcookies.org  PASS 
https://mirror.co.uk  PASS 
https://nikkei.com  PASS 
https://abc.net.au  PASS 
https://ign.com  PASS 
https://walmart.com  PASS 
https://ipv4.google.com  PASS 
https://bandcamp.com  PASS 
https://m.wikipedia.org  PASS 
https://metro.co.uk  PASS 
https://depositfiles.com  PASS 
https://wp.com  PASS 
https://stackoverflow.com  PASS 
https://oup.com  PASS 
https://amazon.es  PASS 
https://ietf.org  PASS 
https://hp.com  PASS 
https://bund.de  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://secureserver.net  PASS 
https://cornell.edu  PASS 
https://techcrunch.com  PASS 
https://buzzfeed.com  PASS 
https://britannica.com  PASS 
https://yahoo.co.jp  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://gofundme.com  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://ft.com  PASS 
https://alexa.com  PASS 
https://ytimg.com  FAIL curl: (6) Could not resolve host: ytimg.com
https://abc.es  PASS 
https://npr.org  PASS 
https://kickstarter.com  PASS 
https://shutterstock.com  PASS 
https://columbia.edu  PASS 
https://google.nl  PASS 
https://unesco.org  FAIL curl: (28) Connection timed out after 60001 milliseconds
https://instagram.com  PASS 
https://my.yahoo.com  PASS 
https://researchgate.net  PASS 
https://urbandictionary.com  PASS 
https://bloglovin.com  PASS 
https://google.com.tw  PASS 
https://umich.edu  PASS 
https://chicagotribune.com  FAIL curl: (51) SSL: no alternative certificate subject name matches target host name 'chicagotribune.com'
https://list-manage.com  FAIL curl: (51) SSL: no alternative certificate subject name matches target host name 'list-manage.com'
https://ted.com  PASS 
https://playstation.com  PASS 
https://psychologytoday.com  PASS 
https://ovh.com  PASS 
https://privacyshield.gov  FAIL curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to privacyshield.gov:443
https://ggpht.com  FAIL curl: (6) Could not resolve host: ggpht.com
https://groups.google.com  PASS 
https://pixabay.com  PASS 
https://yandex.ru  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://dw.com  PASS 
https://addtoany.com  PASS 
https://code.google.com  PASS 
https://instructables.com  PASS 
https://quora.com  PASS 
https://gizmodo.com  PASS 
https://huawei.com  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://weibo.com  PASS 
https://nypost.com  PASS 
https://discord.com  PASS 
https://rottentomatoes.com  PASS 
https://netvibes.com  PASS 
https://mozilla.com  PASS 
https://noaa.gov  PASS 
https://economist.com  PASS 
https://google.co.in  PASS 
https://ovh.net  FAIL curl: (60) SSL certificate problem: certificate has expired More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://newsweek.com  PASS 
https://nydailynews.com  FAIL curl: (35) error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
https://sapo.pt  PASS 
https://ibm.com  PASS 
https://fda.gov  FAIL curl: (6) Could not resolve host: fda.gov
https://hm.com  PASS 
https://addthis.com  FAIL curl: (35) error:14094438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error
https://nginx.org  PASS 
https://ovh.co.uk  PASS 
https://guardian.co.uk  PASS 
https://ria.ru  PASS 
https://gnu.org  PASS 
https://cbsnews.com  PASS 
https://www.wix.com  PASS 
https://yelp.com  PASS 
https://asus.com  FAIL curl: (7) Failed to connect to asus.com port 443: Connection refused
https://amazon.fr  PASS 
https://search.yahoo.com  PASS 
https://20minutos.es  PASS 
https://discord.gg  PASS 
https://ja.wikipedia.org  PASS 
https://express.co.uk  PASS 
https://espn.com  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://doubleclick.net  PASS 
https://naver.com  PASS 
https://google.co.id  PASS 
https://shopify.com  PASS 
https://digg.com  PASS 
https://bitly.com  PASS 
https://pbs.org  PASS 
https://mit.edu  PASS 
https://t.co  PASS 
https://sciencemag.org  PASS 
https://sciencedirect.com  PASS 
https://soundcloud.com  PASS 
https://engadget.com  PASS 
https://tripadvisor.com  PASS 
https://oracle.com  PASS 
https://blackberry.com  PASS 
https://nbcnews.com  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://mashable.com  PASS 
https://smh.com.au  PASS 
https://gmail.com  PASS 
https://bing.com  PASS 
https://thetimes.co.uk  PASS 
https://www.wikipedia.org  PASS 
https://sfgate.com  PASS 
https://berkeley.edu  PASS 
https://ca.gov  PASS 
https://adssettings.google.com  PASS 
https://washington.edu  PASS 
https://afternic.com  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://nationalgeographic.com  PASS 
https://akamaihd.net  FAIL curl: (6) Could not resolve host: akamaihd.net
https://whitehouse.gov  PASS 
https://spiegel.de  PASS 
https://rapidshare.com  FAIL curl: (7) Failed to connect to rapidshare.com port 443: Connection refused
https://e-monsite.com  PASS 
https://finance.yahoo.com  PASS 
https://detik.com  PASS 
https://box.com  PASS 
https://elmundo.es  PASS 
https://rt.com  PASS 
https://mysql.com  PASS 
https://nature.com  PASS 
https://cnbc.com  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://godaddy.com  FAIL curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to godaddy.com:443
https://sendspace.com  PASS 
https://theverge.com  PASS 
https://about.com  PASS 
https://ru.wikipedia.org  PASS 
https://variety.com  PASS 
https://www.over-blog.com  PASS 
https://googleblog.com  PASS 
https://yadi.sk  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://zendesk.com  PASS 
https://google.ca  PASS 
https://deezer.com  PASS 
https://utexas.edu  PASS 
https://standard.co.uk  PASS 
https://princeton.edu  PASS 
https://merriam-webster.com  PASS 
https://sina.com.cn  PASS 
https://techradar.com  PASS 
https://corriere.it  PASS 
https://axs.com  PASS 
https://wiktionary.org  PASS 
https://airbnb.com  PASS 
https://xinhuanet.com  FAIL curl: (7) Failed to connect to xinhuanet.com port 443: Connection timed out
https://feedburner.google.com  PASS 
https://wisc.edu  PASS 
https://prnewswire.com  PASS 
https://ed.gov  PASS 
https://worldbank.org  PASS 
https://investopedia.com  PASS 
https://imgur.com  PASS 
https://orange.fr  PASS 
https://nvidia.com  PASS 
https://wn.com  PASS 
https://megaupload.com  FAIL curl: (6) Could not resolve host: megaupload.com
https://ameblo.jp  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://politico.com  PASS 
https://foursquare.com  PASS 
https://www.canalblog.com  PASS 
https://bp1.blogger.com  PASS 
https://dribbble.com  PASS 
https://cia.gov  PASS 
https://irs.gov  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://fortune.com  PASS 
https://epa.gov  PASS 
https://statista.com  PASS 
https://groups.yahoo.com  PASS 
https://undeveloped.com  PASS 
https://springer.com  PASS 
https://elsevier.com  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://prezi.com  PASS 
https://mixcloud.com  PASS 
https://vkontakte.ru  PASS 
https://skype.com  PASS 
https://viglink.com  PASS 
https://marketwatch.com  PASS 
https://dreniq.com  PASS 
https://amazon.in  PASS 
https://storage.canalblog.com  PASS 
https://dot.tk  FAIL curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to dot.tk:443
https://eff.org  PASS 
https://plos.org  PASS 
https://home.neustar  PASS 
https://theglobeandmail.com  PASS 
https://thefreedictionary.com  PASS 
https://histats.com  PASS 
https://zeit.de  PASS 
https://narod.ru  PASS 
https://sports.yahoo.com  PASS 
https://yale.edu  PASS 
https://daum.net  PASS 
https://jstor.org  PASS 
https://ucoz.ru  PASS 
https://gooyaabitemplates.com  PASS 
https://hbr.org  PASS 
https://slate.com  PASS 
https://com.com  PASS 
https://howstuffworks.com  PASS 
https://pcmag.com  PASS 
https://so-net.ne.jp  PASS 
https://billboard.com  PASS 
https://cmu.edu  PASS 
https://goo.ne.jp  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://freepik.com  PASS 
https://thoughtco.com  PASS 
https://feedproxy.google.com  PASS 
https://pexels.com  PASS 
https://espn.go.com  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://fb.me  PASS 
https://ubuntu.com  PASS 
https://thenextweb.com  PASS 
https://over-blog-kiwi.com  PASS 
https://weather.com  PASS 
https://lonelyplanet.com  PASS 
https://en.wordpress.com  PASS 
https://ebay.co.uk  PASS 
https://iso.org  PASS 
https://thestar.com  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://businessinsider.com.au  PASS 
https://usgs.gov  PASS 
https://jhu.edu  PASS 
https://answers.yahoo.com  PASS 
https://google.com.au  PASS 
https://orkut.com.br  FAIL curl: (28) Connection timed out after 60001 milliseconds
https://amazon.ca  PASS 
https://kotaku.com  PASS 
https://softonic.com  PASS 
https://prestashop.com  FAIL curl: (60) SSL certificate problem: self signed certificate in certificate chain More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://target.com  PASS 
https://timeout.com  PASS 
https://canada.ca  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://000webhost.com  PASS 
https://fifa.com  PASS 
https://parallels.com  PASS 
https://reverbnation.com  PASS 
https://oecd.org  PASS 
https://si.edu  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://sky.com  PASS 
https://insider.com  PASS 
https://canva.com  PASS 
https://soratemplates.com  PASS 
https://iubenda.com  PASS 
https://offset.com  PASS 
https://snapchat.com  PASS 
https://evernote.com  PASS 
https://scientificamerican.com  PASS 
https://psu.edu  PASS 
https://rollingstone.com  PASS 
https://cam.ac.uk  FAIL curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
https://doi.org  PASS 
https://etsy.com  PASS 
https://inc.com  PASS 
https://nicovideo.jp  PASS 
https://ap.org  PASS 
https://adweek.com  PASS 
https://dictionary.com  PASS 
https://newyorker.com  PASS 
https://channel4.com  PASS 
https://steamcommunity.com  PASS 
https://about.me  PASS 
https://nokia.com  PASS 
https://coursera.org  PASS 
https://rediff.com  PASS 
https://venturebeat.com  PASS 
https://www.livejournal.com  PASS 
https://biblegateway.com  PASS 
https://mystrikingly.com  PASS 
https://softpedia.com  PASS 
https://unicef.org  PASS 
https://debian.org  PASS 
https://fastcompany.com  PASS 

View file

@ -1,932 +0,0 @@
https://www.facebook.com/
https://www.yahoo.com/
https://www.live.com/
https://www.wikipedia.org/
https://www.msn.com/
https://www.microsoft.com/
https://www.blogspot.com/
https://www.baidu.com/
https://www.qq.com/
https://www.mozilla.com/
https://www.sina.com.cn/
https://www.wordpress.com/
https://www.bing.com/
https://www.adobe.com/
https://www.163.com/
https://www.taobao.com/
https://www.soso.com/
https://www.twitter.com/
https://www.youku.com/
https://www.ask.com/
https://www.sohu.com/
https://www.amazon.com/
https://www.windows.com/
https://www.ebay.com/
https://www.yahoo.co.jp/
https://www.apple.com/
https://www.tudou.com/
https://www.conduit.com/
https://www.hotmail.com/
https://www.flickr.com/
https://www.photobucket.com/
https://www.tianya.cn/
https://www.about.com/
https://www.cnet.com/
https://www.hao123.com/
https://www.iefxz.com/
https://www.xunlei.com/
https://www.paypal.com/
https://www.go.com/
https://www.fc2.com/
https://www.bbc.co.uk/
https://www.imdb.com/
https://www.orkut.com/
https://www.sogou.com/
https://www.56.com/
https://www.aol.com/
https://www.craigslist.org/
https://www.rakuten.co.jp/
https://www.imageshack.us/
https://www.ku6.com/
https://www.blogger.com/
https://www.goo.ne.jp/
https://www.ifeng.com/
https://www.linkedin.com/
https://www.yandex.ru/
https://www.mail.ru/
https://www.partypoker.com/
https://www.answers.com/
https://www.alibaba.com/
https://www.hi5.com/
https://www.cnn.com/
https://www.amazon.co.jp/
https://www.4shared.com/
https://www.ameblo.jp/
https://www.skype.com/
https://www.renren.com/
https://www.dailymotion.com/
https://www.naver.com/
https://www.weather.com/
https://www.mozilla.org/
https://www.mediafire.com/
https://www.bit.ly/
https://www.hp.com/
https://www.livedoor.jp/
https://www.ehow.com/
https://www.nifty.com/
https://www.vkontakte.ru/
https://www.alipay.com/
https://www.nytimes.com/
https://www.sourceforge.net/
https://www.fbcdn.net/
https://www.xtendmedia.com/
https://www.xinhuanet.com/
https://www.wikimedia.org/
https://www.pconline.com.cn/
https://www.daum.net/
https://www.4399.com/
https://www.bankofamerica.com/
https://www.ebay.de/
https://www.uol.com.br/
https://www.zol.com.cn/
https://www.mop.com/
https://www.alexa.com/
https://www.biglobe.ne.jp/
https://www.scribd.com/
https://www.softonic.com/
https://www.mapquest.com/
https://www.dell.com/
https://www.people.com.cn/
https://www.facebook.com/
https://www.yahoo.com/
https://www.live.com/
https://www.wikipedia.org/
https://www.msn.com/
https://www.microsoft.com/
https://www.blogspot.com/
https://www.baidu.com/
https://www.qq.com/
https://www.mozilla.com/
https://www.sina.com.cn/
https://www.wordpress.com/
https://www.bing.com/
https://www.adobe.com/
https://www.kaixin001.com/
https://www.geocities.jp/
https://www.ebay.co.uk/
https://www.hatena.ne.jp/
https://www.seesaa.net/
https://www.badoo.com/
https://www.126.com/
https://www.paipai.com/
https://www.avg.com/
https://www.pps.tv/
https://www.odnoklassniki.ru/
https://www.free.fr/
https://www.infoseek.co.jp/
https://www.zynga.com/
https://www.depositfiles.com/
https://www.metacafe.com/
https://www.chase.com/
https://www.thepiratebay.org/
https://www.kakaku.com/
https://www.cctv.com/
https://www.optmd.com/
https://www.hotfile.com/
https://www.com.com/
https://www.ning.com/
https://www.ocn.ne.jp/
https://www.vk.com/
https://www.game2.com.cn/
https://www.youdao.com/
https://www.getpersonas.com/
https://www.tripadvisor.com/
https://www.nate.com/
https://www.livejournal.com/
https://www.soufun.com/
https://www.zedo.com/
https://www.thefreedictionary.com/
https://www.2ch.net/
https://www.tinypic.com/
https://www.java.com/
https://www.narod.ru/
https://www.xici.net/
https://www.walmart.com/
https://www.114la.com/
https://www.joy.cn/
https://www.addthis.com/
https://www.globo.com/
https://www.360.cn/
https://www.cocolog-nifty.com/
https://www.netflix.com/
https://www.target.com/
https://www.58.com/
https://www.cyworld.com/
https://www.tom.com/
https://www.amazon.de/
https://www.netlog.com/
https://www.amazon.co.uk/
https://www.reference.com/
https://www.douban.com/
https://www.eastmoney.com/
https://www.livedoor.com/
https://www.hexun.com/
https://www.liveperson.net/
https://www.7k7k.com/
https://www.miniclip.com/
https://www.so-net.ne.jp/
https://www.39.net/
https://www.nih.gov/
https://www.sakura.ne.jp/
https://www.rambler.ru/
https://www.reuters.com/
https://www.kugou.com/
https://www.mixi.jp/
https://www.terra.com.br/
https://www.tripod.com/
https://www.mcafee.com/
https://www.att.com/
https://www.weather.com.cn/
https://www.tagged.com/
https://www.2345.com/
https://www.zing.vn/
https://www.exblog.jp/
https://www.chinamobile.com/
https://www.expedia.com/
https://www.ameba.jp/
https://www.tinyurl.com/
https://www.chinanews.com.cn/
https://www.commentcamarche.net/
https://www.allabout.co.jp/
https://www.taringa.net/
https://www.nicovideo.jp/
https://www.domaintools.com/
https://www.excite.co.jp/
https://www.autohome.com.cn/
https://www.typepad.com/
https://www.ezinearticles.com/
https://www.shopping.com/
https://www.deviantart.com/
https://www.marketgid.com/
https://www.ikea.com/
https://www.yomiuri.co.jp/
https://www.maktoob.com/
https://www.web.de/
https://www.informharry.com/
https://www.alimama.com/
https://www.ynet.com/
https://www.softpedia.com/
https://www.china.com/
https://www.6.cn/
https://www.5599.net/
https://www.cntv.cn/
https://www.booking.com/
https://www.orange.fr/
https://www.verycd.com/
https://www.multiply.com/
https://www.comcast.net/
https://www.skycn.com/
https://www.libero.it/
https://www.onet.pl/
https://www.rediff.com/
https://www.americanexpress.com/
https://www.dailymail.co.uk/
https://www.alot.com/
https://www.nasza-klasa.pl/
https://www.pchome.net/
https://www.51job.com/
https://www.okwave.jp/
https://www.70yx.com/
https://www.rakuten.ne.jp/
https://www.nikkeibp.co.jp/
https://www.mlb.com/
https://www.huffingtonpost.com/
https://www.bestbuy.com/
https://www.freelotto.com/
https://www.yahoo.net/
https://www.docstoc.com/
https://www.csdn.net/
https://www.digg.com/
https://www.macromedia.com/
https://www.tumblr.com/
https://www.twitpic.com/
https://www.impress.co.jp/
https://www.foxsports.com/
https://www.wikia.com/
https://www.t-online.de/
https://www.verizonwireless.com/
https://www.justin.tv/
https://www.ups.com/
https://www.wp.pl/
https://www.docin.com/
https://www.pdfqueen.com/
https://www.dangdang.com/
https://www.focus.cn/
https://www.ziddu.com/
https://www.hubpages.com/
https://www.kioskea.net/
https://www.babylon.com/
https://www.last.fm/
https://www.wellsfargo.com/
https://www.gmx.net/
https://www.friendster.com/
https://www.wsj.com/
https://www.slideshare.net/
https://www.foxnews.com/
https://www.ganji.com/
https://www.iza.ne.jp/
https://www.51.com/
https://www.metrolyrics.com/
https://www.yesky.com/
https://www.usps.com/
https://www.mainichi.jp/
https://www.irs.gov/
https://www.bigpoint.com/
https://www.china.com.cn/
https://www.iciba.com/
https://www.hulu.com/
https://www.gmarket.co.kr/
https://www.tabelog.com/
https://www.gamespot.com/
https://www.symantec.com/
https://www.nokia.com/
https://www.pcpop.com/
https://www.torrentz.com/
https://www.pptv.com/
https://www.telegraph.co.uk/
https://www.duowan.com/
https://www.joins.com/
https://www.wordreference.com/
https://www.ign.com/
https://www.huanqiu.com/
https://www.aweber.com/
https://www.guardian.co.uk/
https://www.samsung.com/
https://www.skyrock.com/
https://www.sun.com/
https://www.the2009.cn/
https://www.musica.com/
https://www.icq.com/
https://www.allegro.pl/
https://www.virgilio.it/
https://www.nhk.or.jp/
https://www.linekong.com/
https://www.hudong.com/
https://www.comcast.com/
https://www.pcauto.com.cn/
https://www.sponichi.co.jp/
https://www.isohunt.com/
https://www.traviangames.com/
https://www.zimbio.com/
https://www.robtex.com/
https://www.wretch.cc/
https://www.japanpost.jp/
https://www.onlinedown.net/
https://www.godaddy.com/
https://www.vimeo.com/
https://www.qidian.com/
https://www.mapion.co.jp/
https://www.washingtonpost.com/
https://www.118114.cn/
https://www.ieaddons.com/
https://www.wikimapia.org/
https://www.jiayuan.com/
https://www.sanspo.com/
https://www.whitepages.com/
https://www.yelp.com/
https://www.real.com/
https://www.bizrate.com/
https://www.amazon.cn/
https://www.hc360.com/
https://www.17173.com/
https://www.ineedfile.com/
https://www.360buy.com/
https://www.8684.cn/
https://www.pplive.com/
https://www.over-blog.com/
https://www.baixaki.com.br/
https://www.beemp3.com/
https://www.cnzz.com/
https://www.usatoday.com/
https://www.tenpay.com/
https://www.asahi.com/
https://www.surveymonkey.com/
https://www.21cn.com/
https://www.nba.com/
https://www.informer.com/
https://www.intuit.com/
https://www.letitbit.net/
https://www.plala.or.jp/
https://www.homedepot.com/
https://www.ctrip.com/
https://www.opera.com/
https://www.37cs.com/
https://www.jiji.com/
https://www.ucoz.ru/
https://www.webmd.com/
https://www.sonico.com/
https://www.avast.com/
https://www.linternaute.com/
https://www.letv.com/
https://www.ip138.com/
https://www.careerbuilder.com/
https://www.ibm.com/
https://www.associatedcontent.com/
https://www.gnavi.co.jp/
https://www.rincondelvago.com/
https://www.indiatimes.com/
https://www.ddmap.com/
https://www.veoh.com/
https://www.dtiblog.com/
https://www.zylom.com/
https://www.monografias.com/
https://www.auction.co.kr/
https://www.fedex.com/
https://www.liveinternet.ru/
https://www.koubei.com/
https://www.game2.cn/
https://www.suite101.com/
https://www.squidoo.com/
https://www.teacup.com/
https://www.addictinggames.com/
https://www.filehippo.com/
https://www.sdo.com/
https://www.ustream.tv/
https://www.tistory.com/
https://www.115.com/
https://www.liutilities.com/
https://www.jalan.net/
https://www.webs.com/
https://www.naqigs.com/
https://www.it168.com/
https://www.etology.com/
https://www.everesttech.net/
https://www.intelius.com/
https://www.sina.com/
https://www.pomoho.com/
https://www.serving-sys.com/
https://www.sciencedirect.com/
https://www.ccbill.com/
https://www.incredimail.com/
https://www.capitalone.com/
https://www.yellowpages.com/
https://www.geocities.co.jp/
https://www.ebay.it/
https://www.glispa.com/
https://www.hotels.com/
https://www.opendns.com/
https://www.engadget.com/
https://www.chosun.com/
https://www.y8.com/
https://www.ourtoolbar.com/
https://www.oricon.co.jp/
https://www.downloadhelper.net/
https://www.oyunlar1.com/
https://www.vector.co.jp/
https://www.cmbchina.com/
https://www.farmville.com/
https://www.120ask.com/
https://www.chip.de/
https://www.atwiki.jp/
https://www.zhaopin.com/
https://www.freeonlinegames.com/
https://www.wordpress.org/
https://www.latimes.com/
https://www.fotolog.com/
https://www.mp3raid.com/
https://www.boston.com/
https://www.mobile.de/
https://www.aufeminin.com/
https://www.wikihow.com/
https://www.11st.co.kr/
https://www.yaplog.jp/
https://www.merriam-webster.com/
https://www.itmedia.co.jp/
https://www.cookpad.com/
https://www.mercadolivre.com.br/
https://www.tu.tv/
https://www.wauee.com/
https://www.priceline.com/
https://www.zshare.net/
https://www.qunar.com/
https://www.ryanair.com/
https://www.interia.pl/
https://www.ig.com.br/
https://www.monster.com/
https://www.archive.org/
https://www.alice.it/
https://www.xinmin.cn/
https://www.fixya.com/
https://www.nikkansports.com/
https://www.funshion.com/
https://www.sears.com/
https://www.bild.de/
https://www.ebay.fr/
https://www.iminent.com/
https://www.uploading.com/
https://www.baofeng.com/
https://www.1ting.com/
https://www.kuwo.cn/
https://www.bitauto.com/
https://www.tiexue.net/
https://www.mpnrs.com/
https://www.nowdownloadall.com/
https://www.southwest.com/
https://www.ce.cn/
https://www.in.com/
https://www.allrecipes.com/
https://www.travelocity.com/
https://www.people.com/
https://www.timesonline.co.uk/
https://www.dealtime.com/
https://www.ticketmaster.com/
https://www.mtv.com/
https://www.gazeta.pl/
https://www.bin-layer.de/
https://www.9wee.com/
https://www.donga.com/
https://www.lowes.com/
https://www.fanpop.com/
https://www.cnxad.com/
https://www.angelfire.com/
https://www.blackberry.com/
https://www.01net.com/
https://www.wunderground.com/
https://www.news.cn/
https://www.sapo.pt/
https://www.nydailynews.com/
https://www.mtime.com/
https://www.univision.com/
https://www.sfr.fr/
https://www.winamp.com/
https://www.webshots.com/
https://www.enet.com.cn/
https://www.made-in-china.com/
https://www.constantcontact.com/
https://www.examiner.com/
https://www.pandora.tv/
https://www.abril.com.br/
https://www.indeed.com/
https://www.overstock.com/
https://www.xywy.com/
https://www.gizmodo.com/
https://www.wiktionary.org/
https://www.shinobi.jp/
https://www.pandora.com/
https://www.dianping.com/
https://www.repubblica.it/
https://www.360doc.com/
https://www.duote.com/
https://www.176.com/
https://www.intel.com/
https://www.accountonline.com/
https://www.altervista.org/
https://www.rapid-downloads.com/
https://www.xe.com/
https://www.pixnet.net/
https://www.ebuddy.com/
https://www.radikal.ru/
https://www.webgame.com.cn/
https://www.jcpenney.com/
https://www.armorgames.com/
https://www.information.com/
https://www.downloadcave.com/
https://www.orbitz.com/
https://www.ca.gov/
https://www.zaycev.net/
https://www.imvu.com/
https://www.rian.ru/
https://www.usagc.org/
https://www.metroflog.com/
https://www.medicinenet.com/
https://www.classmates.com/
https://www.windowsmedia.com/
https://www.detik.com/
https://www.mk.co.kr/
https://www.microsofttranslator.com/
https://www.verizon.net/
https://www.cartoonnetwork.com/
https://www.mt.co.kr/
https://www.rr.com/
https://www.fresheye.com/
https://www.sweetim.com/
https://www.stumbleupon.com/
https://www.myvideo.de/
https://www.hotpepper.jp/
https://www.pcgames.com.cn/
https://www.costco.com/
https://www.uploaded.to/
https://www.xiaonei.com/
https://www.24h.com.vn/
https://www.mafiawars.com/
https://www.priceminister.com/
https://www.w3.org/
https://www.nhaccuatui.com/
https://www.vnexpress.net/
https://www.foxnetworks.com/
https://www.freakshare.net/
https://www.rutracker.org/
https://www.elmundo.es/
https://www.torrentreactor.net/
https://www.best-price.com/
https://www.nasa.gov/
https://www.mdinfo.com/
https://www.limewire.com/
https://www.wer-kennt-wen.de/
https://www.nikkei.com/
https://www.gap.com/
https://www.wiley.com/
https://www.time.com/
https://www.elsevier.com/
https://www.howstuffworks.com/
https://www.agame.com/
https://www.che168.com/
https://www.corriere.it/
https://www.xorg.pl/
https://www.wachovia.com/
https://www.thesun.co.uk/
https://www.girlsgogames.com/
https://www.piriform.com/
https://www.rbc.ru/
https://www.spiegel.de/
https://www.tbs.co.jp/
https://www.europa.eu/
https://www.btjunkie.org/
https://www.vancl.com/
https://www.citibank.com/
https://www.clubpenguin.com/
https://www.verizon.com/
https://www.forbes.com/
https://www.delta.com/
https://www.sky.com/
https://www.nikkei.co.jp/
https://www.norton.com/
https://www.rapid4me.com/
https://www.seznam.cz/
https://www.zoosk.com/
https://www.jstor.org/
https://www.19lou.com/
https://www.juegos.com/
https://www.easyjet.com/
https://www.hyves.nl/
https://www.cbsnews.com/
https://www.yoka.com/
https://www.mylife.com/
https://www.jrj.com.cn/
https://www.businessweek.com/
https://www.partypoker.it/
https://www.shop-pro.jp/
https://www.taleo.net/
https://www.dantri.com.vn/
https://www.pcworld.com/
https://www.xcar.com.cn/
https://www.chinaz.com/
https://www.nike.com/
https://www.ya.ru/
https://www.picnik.com/
https://www.pchome.com.tw/
https://www.with2.net/
https://www.pogo.com/
https://www.fanbox.com/
https://www.95599.cn/
https://www.evite.com/
https://www.hankooki.com/
https://www.stayfriends.de/
https://www.gutefrage.net/
https://www.logmein.com/
https://www.break.com/
https://www.mercadolibre.com.mx/
https://www.blogcu.com/
https://www.winzip.com/
https://www.bahn.de/
https://www.topshareware.com/
https://www.acer.com/
https://www.mynet.com/
https://www.urbandictionary.com/
https://www.sanook.com/
https://www.rayfile.com/
https://www.usenet.nl/
https://www.encyclopedia.com/
https://www.imagevenue.com/
https://www.qip.ru/
https://www.discovery.com/
https://www.yam.com/
https://www.265.com/
https://www.mashable.com/
https://www.me.com/
https://www.yandex.ua/
https://www.foodnetwork.com/
https://www.freewebs.com/
https://www.sonyericsson.com/
https://www.61.com/
https://www.articlesbase.com/
https://www.mufg.jp/
https://www.xrea.com/
https://www.chinacars.com/
https://www.cri.cn/
https://www.movies-links.tv/
https://www.match.com/
https://www.livescore.com/
https://www.zhcw.com/
https://www.ebay.com.au/
https://www.istockphoto.com/
https://www.speedtest.net/
https://www.sprint.com/
https://www.superpages.com/
https://www.infospace.com/
https://www.accuweather.com/
https://www.doctissimo.fr/
https://www.msn.com.cn/
https://www.t-mobile.com/
https://www.tuenti.com/
https://www.tmz.com/
https://www.otto.de/
https://www.gemius.pl/
https://www.shoplocal.com/
https://www.barnesandnoble.com/
https://www.pclady.com.cn/
https://www.ninemsn.com.au/
https://www.wanfangdata.com.cn/
https://www.pronto.com/
https://www.baixing.com/
https://www.worldstarhiphop.com/
https://www.yahoo.com.tw/
https://www.cnki.com.cn/
https://www.w3schools.com/
https://www.unlimited-downloads.biz/
https://www.carview.co.jp/
https://www.zjol.com.cn/
https://www.bebo.com/
https://www.hinet.net/
https://www.buzzle.com/
https://www.schuelervz.net/
https://www.nationalgeographic.com/
https://www.local.com/
https://www.tv.com/
https://www.kaskus.us/
https://www.etsy.com/
https://www.eastday.com/
https://www.shumenol.com/
https://www.sendspace.com/
https://www.citysearch.com/
https://www.zaobao.com/
https://www.ed.gov/
https://www.irctc.co.in/
https://www.downtr.net/
https://www.playstation.com/
https://www.elpais.com/
https://www.utorrent.com/
https://www.blogmura.com/
https://www.mapbar.com/
https://www.readnovel.com/
https://www.m1905.com/
https://www.marriott.com/
https://www.popeater.com/
https://www.jsoftj.com/
https://www.tweetmeme.com/
https://www.hm.com/
https://www.travelzoo.com/
https://www.torrentdownloads.net/
https://www.izlesene.com/
https://www.studivz.net/
https://www.hilton.com/
https://www.kayak.com/
https://www.zappos.com/
https://www.realtor.com/
https://www.abchina.com/
https://www.hurra.com/
https://www.aa.com/
https://www.uuu9.com/
https://www.cricinfo.com/
https://www.52pk.com/
https://www.searchignite.com/
https://www.chinadaily.com.cn/
https://www.newegg.com/
https://www.timeanddate.com/
https://www.direct.gov.uk/
https://www.pctools.com/
https://www.27.cn/
https://www.tgbus.com/
https://www.fc2web.com/
https://www.mozdev.org/
https://www.marca.com/
https://www.udn.com/
https://www.amazon.fr/
https://www.weblio.jp/
https://www.changyou.com/
https://www.daily.co.jp/
https://www.thefind.com/
https://www.nttdocomo.co.jp/
https://www.kohls.com/
https://www.walkerplus.com/
https://www.babycenter.com/
https://www.ow.ly/
https://www.toocle.com/
https://www.webcrawler.com/
https://www.stackoverflow.com/
https://www.ekolay.net/
https://www.kuronekoyamato.co.jp/
https://www.vzw.com/
https://www.buzznet.com/
https://www.wetter.com/
https://www.dospy.com/
https://www.fidelity.com/
https://www.gismeteo.ru/
https://www.ft.com/
https://www.freedownloadscenter.com/
https://www.bidders.co.jp/
https://www.tesco.com/
https://www.azlyrics.com/
https://www.legacy.com/
https://www.tf1.fr/
https://www.nhl.com/
https://www.mycom.co.jp/
https://www.rtl.de/
https://www.hankyung.com/
https://www.edeng.cn/
https://www.immobilienscout24.de/
https://www.gigazine.net/
https://www.marketwatch.com/
https://www.xuite.net/
https://www.techcrunch.com/
https://www.inowdownload.com/
https://www.kooora.com/
https://www.zdnet.com/
https://www.causes.com/
https://www.imagebam.com/
https://www.thesaurus.com/
https://www.boc.cn/
https://www.kapook.com/
https://www.argos.co.uk/
https://www.kp.ru/
https://www.uniblue.com/
https://www.boosj.com/
https://www.meebo.com/
https://www.redtram.com/
https://www.qianlong.com/
https://www.top100.cn/
https://www.ancestry.com/
https://www.pricegrabber.com/
https://www.pkr.com/
https://www.php.net/
https://www.ea.com/
https://www.rutube.ru/
https://www.qingdaonews.com/
https://www.sbs.co.kr/
https://www.shvoong.com/
https://www.kaspersky.com/
https://www.bigfishgames.com/
https://www.xing.com/
https://www.sing365.com/
https://www.bloomberg.com/
https://www.newhua.com/
https://www.asiae.co.kr/
https://www.aolnews.com/
https://www.bdr130.net/
https://www.picktorrent.com/
https://www.pixmania.com/
https://www.wired.com/
https://www.vatgia.com/
https://www.divx.com/
https://www.ana.co.jp/
https://www.fandango.com/
https://www.seoul.co.kr/
https://www.appspot.com/
https://www.bandoo.com/
https://www.city-data.com/
https://www.wisegeek.com/
https://www.ocnk.net/
https://www.hunantv.com/
https://www.kijiji.ca/
https://www.cnki.net/
https://www.panasonic.jp/
https://www.allocine.fr/
https://www.chinahr.com/
https://www.emagister.com/
https://www.manta.com/
https://www.rayli.com.cn/
https://www.asahi-net.or.jp/
https://www.dreamstime.com/
https://www.lastminute.com/
https://www.nick.com/
https://www.deezer.com/
https://www.bohelady.com/
https://www.esmas.com/
https://www.vente-privee.com/
https://www.lyricsmode.com/
https://www.findarticles.com/
https://www.47news.jp/
https://www.staples.com/
https://www.songs.pk/
https://www.bomb-mp3.com/
https://www.cqvip.com/
https://www.autoscout24.de/
https://www.victoriassecret.com/
https://www.acrobat.com/
https://www.national-lottery.co.uk/
https://www.mayoclinic.com/
https://www.zillow.com/
https://www.onemanga.com/
https://www.playsushi.com/
https://www.answerbag.com/
https://www.ukr.net/
https://www.citicards.com/
https://www.kaixin.com/
https://www.kbs.co.kr/
https://www.toysrus.com/
https://www.freshwap.net/
https://www.vertor.com/
https://www.mahalo.com/
https://www.hurriyet.com.tr/
https://www.mercadolibre.com.ar/
https://www.shangdu.com/
https://www.barbie.com/
https://www.interpark.com/
https://www.mizuhobank.co.jp/
https://www.hotwire.com/
https://www.kompas.com/
https://www.rising.com.cn/
https://www.blurtit.com/
https://www.newgrounds.com/
https://www.mundoanuncio.com/
https://www.marktplaats.nl/
https://www.ringtonematcher.com/
https://www.goal.com/
https://www.xs8.cn/
https://www.mthai.com/
https://www.clarin.com/
https://www.openoffice.org/
https://www.ciao.de/
https://www.jal.co.jp/
https://www.lyrics007.com/
https://www.ovguide.com/
https://www.ultimate-guitar.com/
https://www.mobile01.com/
https://www.vdisk.cn/
https://www.buy.com/
https://www.computerbild.de/
https://www.usgs.gov/
https://www.te3p.com/
https://www.cooks.com/
https://www.mcssl.com/
https://www.reverso.net/
https://www.merchantcircle.com/
https://www.tiancity.com/
https://www.dropbox.com/
https://www.yfrog.com/
https://www.tiscali.it/
https://www.xbox.com/
https://www.easy-share.com/
https://www.autotrader.com/
https://www.gotomeeting.com/
https://www.download-gate.com/
https://www.nfl.com/
https://www.experts-exchange.com/
https://www.cool.ne.jp/
https://www.fx120.net/
https://www.ntv.co.jp/
https://www.meinvz.net/
https://www.king.com/
https://www.virginmedia.com/
https://www.google.com/
https://www.youtube.com/

View file

@ -1,500 +0,0 @@
https://google.com
https://apple.co
https://youtube.co
https://play.google.com
https://support.google.com
https://cloudflare.com
https://blogger.com
https://microsoft.com
https://linkedin.com
https://docs.google.com
https://youtu.be
https://wordpress.org
https://maps.google.com
https://en.wikipedia.org
https://mozilla.org
https://accounts.google.com
https://googleusercontent.com
https://europa.eu
https://sites.google.com
https://drive.google.com
https://vimeo.com
https://adobe.com
https://plus.google.com
https://es.wikipedia.org
https://pt.wikipedia.org
https://uol.com.br
https://bbc.co.uk
https://amazon.com
https://cnn.com
https://bp.blogspot.com
https://facebook.com
https://vk.com
https://istockphoto.com
https://github.com
https://line.me
https://www.yahoo.com
https://wikimedia.org
https://forbes.com
https://opera.com
https://creativecommons.org
https://brandbucket.com
https://imdb.com
https://google.de
https://dropbox.com
https://google.co.jp
https://live.com
https://bbc.com
https://myspace.com
https://mail.ru
https://reuters.com
https://jimdofree.com
https://theguardian.com
https://google.es
https://medium.com
https://news.google.com
https://dailymotion.com
https://mail.google.com
https://www.weebly.com
https://w3.org
https://t.me
https://feedburner.com
https://whatsapp.com
https://issuu.com
https://fr.wikipedia.org
https://policies.google.com
https://hugedomains.com
https://abril.com.br
https://developers.google.com
https://globo.com
https://google.com.br
https://nih.gov
https://slideshare.net
https://nytimes.com
https://gstatic.com
https://msn.com
https://paypal.com
https://get.google.com
https://www.gov.uk
https://who.int
https://latimes.com
https://steampowered.com
https://bit.ly
https://cdc.gov
https://news.yahoo.com
https://wikia.com
https://apache.org
https://nasa.gov
https://twitter.com
https://un.org
https://books.google.com
https://aboutads.info
https://time.com
https://draft.blogger.com
https://change.org
https://fandom.com
https://google.it
https://rakuten.co.jp
https://tools.google.com
https://buydomains.com
https://webmd.com
https://myaccount.google.com
https://dailymail.co.uk
https://translate.google.com
https://independent.co.uk
https://google.co.uk
https://networkadvertising.org
https://booking.com
https://thesun.co.uk
https://hatena.ne.jp
https://cpanel.com
https://pinterest.com
https://ebay.com
https://cpanel.net
https://archive.org
https://telegraph.co.uk
https://gravatar.com
https://marketingplatform.google.com
https://washingtonpost.com
https://de.wikipedia.org
https://plesk.com
https://wired.com
https://namecheap.com
https://search.google.com
https://fb.com
https://files.wordpress.com
https://mediafire.com
https://dan.com
https://google.pl
https://android.com
https://aol.com
https://telegram.me
https://picasaweb.google.com
https://abcnews.go.com
https://wsj.com
https://it.wikipedia.org
https://scribd.com
https://usatoday.com
https://google.fr
https://youronlinechoices.com
https://lefigaro.fr
https://goo.gl
https://samsung.com
https://terra.com.br
https://amazon.co.jp
https://id.wikipedia.org
https://huffingtonpost.com
https://cnet.com
https://huffpost.com
https://ig.com.br
https://office.com
https://businessinsider.com
https://4shared.com
https://wa.me
https://amazon.co.uk
https://bloomberg.com
https://ok.ru
https://amazon.de
https://harvard.edu
https://foxnews.com
https://photos.google.com
https://aliexpress.com
https://elpais.com
https://google.ru
https://tinyurl.com
https://academia.edu
https://twitch.tv
https://surveymonkey.com
https://rambler.ru
https://stanford.edu
https://wikihow.com
https://eventbrite.com
https://disney.com
https://wiley.com
https://welt.de
https://indiatimes.com
https://pl.wikipedia.org
https://nginx.com
https://cbc.ca
https://spotify.com
https://xbox.com
https://icann.org
https://repubblica.it
https://arxiv.org
https://alibaba.com
https://mega.nz
https://usnews.com
https://enable-javascript.com
https://ziddu.com
https://picasa.google.com
https://lemonde.fr
https://themeforest.net
https://imageshack.com
https://sedo.com
https://sciencedaily.com
https://sputniknews.com
https://netflix.com
https://storage.googleapis.com
https://theatlantic.com
https://imageshack.us
https://goodreads.com
https://php.net
https://loc.gov
https://disqus.com
https://news.com.au
https://photobucket.com
https://lycos.com
https://qq.com
https://forms.gle
https://ikea.com
https://ea.com
https://cambridge.org
https://trustpilot.com
https://biglobe.ne.jp
https://clickbank.net
https://allaboutcookies.org
https://mirror.co.uk
https://nikkei.com
https://abc.net.au
https://ign.com
https://walmart.com
https://ipv4.google.com
https://bandcamp.com
https://m.wikipedia.org
https://metro.co.uk
https://depositfiles.com
https://wp.com
https://stackoverflow.com
https://oup.com
https://amazon.es
https://ietf.org
https://hp.com
https://bund.de
https://secureserver.net
https://cornell.edu
https://techcrunch.com
https://buzzfeed.com
https://britannica.com
https://yahoo.co.jp
https://gofundme.com
https://ft.com
https://alexa.com
https://ytimg.com
https://abc.es
https://npr.org
https://kickstarter.com
https://shutterstock.com
https://columbia.edu
https://google.nl
https://unesco.org
https://instagram.com
https://my.yahoo.com
https://researchgate.net
https://urbandictionary.com
https://bloglovin.com
https://google.com.tw
https://umich.edu
https://chicagotribune.com
https://list-manage.com
https://ted.com
https://playstation.com
https://psychologytoday.com
https://ovh.com
https://privacyshield.gov
https://ggpht.com
https://groups.google.com
https://pixabay.com
https://yandex.ru
https://dw.com
https://addtoany.com
https://code.google.com
https://instructables.com
https://quora.com
https://gizmodo.com
https://huawei.com
https://weibo.com
https://nypost.com
https://discord.com
https://rottentomatoes.com
https://netvibes.com
https://mozilla.com
https://noaa.gov
https://economist.com
https://google.co.in
https://ovh.net
https://newsweek.com
https://nydailynews.com
https://sapo.pt
https://ibm.com
https://fda.gov
https://hm.com
https://addthis.com
https://nginx.org
https://ovh.co.uk
https://guardian.co.uk
https://ria.ru
https://gnu.org
https://cbsnews.com
https://www.wix.com
https://yelp.com
https://asus.com
https://amazon.fr
https://search.yahoo.com
https://20minutos.es
https://discord.gg
https://ja.wikipedia.org
https://express.co.uk
https://espn.com
https://doubleclick.net
https://naver.com
https://google.co.id
https://shopify.com
https://digg.com
https://bitly.com
https://pbs.org
https://mit.edu
https://t.co
https://sciencemag.org
https://sciencedirect.com
https://soundcloud.com
https://engadget.com
https://tripadvisor.com
https://oracle.com
https://blackberry.com
https://nbcnews.com
https://mashable.com
https://smh.com.au
https://gmail.com
https://bing.com
https://thetimes.co.uk
https://www.wikipedia.org
https://sfgate.com
https://berkeley.edu
https://ca.gov
https://adssettings.google.com
https://washington.edu
https://afternic.com
https://nationalgeographic.com
https://akamaihd.net
https://whitehouse.gov
https://spiegel.de
https://rapidshare.com
https://e-monsite.com
https://finance.yahoo.com
https://detik.com
https://box.com
https://elmundo.es
https://rt.com
https://mysql.com
https://nature.com
https://cnbc.com
https://godaddy.com
https://sendspace.com
https://theverge.com
https://about.com
https://ru.wikipedia.org
https://variety.com
https://www.over-blog.com
https://googleblog.com
https://yadi.sk
https://zendesk.com
https://google.ca
https://deezer.com
https://utexas.edu
https://standard.co.uk
https://princeton.edu
https://merriam-webster.com
https://sina.com.cn
https://techradar.com
https://corriere.it
https://axs.com
https://wiktionary.org
https://airbnb.com
https://xinhuanet.com
https://feedburner.google.com
https://wisc.edu
https://prnewswire.com
https://ed.gov
https://worldbank.org
https://investopedia.com
https://imgur.com
https://orange.fr
https://nvidia.com
https://wn.com
https://megaupload.com
https://ameblo.jp
https://politico.com
https://foursquare.com
https://www.canalblog.com
https://bp1.blogger.com
https://dribbble.com
https://cia.gov
https://irs.gov
https://fortune.com
https://epa.gov
https://statista.com
https://groups.yahoo.com
https://undeveloped.com
https://springer.com
https://elsevier.com
https://prezi.com
https://mixcloud.com
https://vkontakte.ru
https://skype.com
https://viglink.com
https://marketwatch.com
https://dreniq.com
https://amazon.in
https://storage.canalblog.com
https://dot.tk
https://eff.org
https://plos.org
https://home.neustar
https://theglobeandmail.com
https://thefreedictionary.com
https://histats.com
https://zeit.de
https://narod.ru
https://sports.yahoo.com
https://yale.edu
https://daum.net
https://jstor.org
https://ucoz.ru
https://gooyaabitemplates.com
https://hbr.org
https://slate.com
https://com.com
https://howstuffworks.com
https://pcmag.com
https://so-net.ne.jp
https://billboard.com
https://cmu.edu
https://goo.ne.jp
https://freepik.com
https://thoughtco.com
https://feedproxy.google.com
https://pexels.com
https://espn.go.com
https://fb.me
https://ubuntu.com
https://thenextweb.com
https://over-blog-kiwi.com
https://weather.com
https://lonelyplanet.com
https://en.wordpress.com
https://ebay.co.uk
https://iso.org
https://thestar.com
https://businessinsider.com.au
https://usgs.gov
https://jhu.edu
https://answers.yahoo.com
https://google.com.au
https://orkut.com.br
https://amazon.ca
https://kotaku.com
https://softonic.com
https://prestashop.com
https://target.com
https://timeout.com
https://canada.ca
https://000webhost.com
https://fifa.com
https://parallels.com
https://reverbnation.com
https://oecd.org
https://si.edu
https://sky.com
https://insider.com
https://canva.com
https://soratemplates.com
https://iubenda.com
https://offset.com
https://snapchat.com
https://evernote.com
https://scientificamerican.com
https://psu.edu
https://rollingstone.com
https://cam.ac.uk
https://doi.org
https://etsy.com
https://inc.com
https://nicovideo.jp
https://ap.org
https://adweek.com
https://dictionary.com
https://newyorker.com
https://channel4.com
https://steamcommunity.com
https://about.me
https://nokia.com
https://coursera.org
https://rediff.com
https://venturebeat.com
https://www.livejournal.com
https://biblegateway.com
https://mystrikingly.com
https://softpedia.com
https://unicef.org
https://debian.org
https://fastcompany.com