This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/esp8266/Arduino/blob/342c4ae6fb847bfc787f80b89a2bb888d942dc32/libraries/ESP8266WiFi/src/include/UdpContext.h#L308 | |
private: | |
void _reserve(size_t size) | |
{ | |
const size_t pbuf_unit_size = 512; | |
if (!_tx_buf_head) | |
{ | |
_tx_buf_head = pbuf_alloc(PBUF_TRANSPORT, pbuf_unit_size, PBUF_RAM); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include "/usr/local/src/ap_setting.h" | |
// Update these with values suitable for your network. | |
char* topic = "/30/Status/MQTT"; | |
char* subtopic = "inTopic"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <PubSubClient.h> | |
#include "/usr/local/src/ap_setting.h" | |
// Update these with values suitable for your network. | |
/* | |
char* topic = "/30/Status/MQTT"; | |
char* subtopic = "inTopic"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int sampleI; | |
int Number_of_Samples; | |
int sumI; | |
void setup() | |
{ | |
Serial.begin(115200); | |
sampleI = 0; | |
sumI = 0; | |
Number_of_Samples = 1000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int testpin1 = 5; | |
void setup() { | |
pinMode(testpin1, OUTPUT); | |
} | |
void loop() { | |
Serial.begin(115200); | |
digitalWrite(testpin1, LOW); | |
delay(2000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include "nRF24L01.h" | |
#include "RF24.h" | |
int senderId; | |
// Set up nRF24L01 radio on SPI bus plus pins 9 & 10 | |
//Contacts from the radio to connect NRF24L01 pinamnam -> Arduino |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <nRF24L01.h> | |
#include <RF24.h> | |
#define DEVICE_ID 2 | |
#define CHANNEL 1 //MAX 127 | |
RF24 radio(15, 15); // Set up nRF24L01 radio on SPI bus plus pins 7 & 8 | |
// Topology | |
const uint64_t pipes[2] = { 0xFFFFFFFFFFLL, 0xCCCCCCCCCCLL }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
WPA2-ENT EAP-TLS | |
based on joostd's code : https://github.com/joostd/esp8266-eduroam | |
https://github.com/joostd/esp8266-eduroam/blob/master/gen_cert.sh | |
wifi_station_set_cert_key | |
Function: Set certificate and private key for connecting to WPA2-ENTERPRISE AP. | |
Note: | |
• Connecting to WPA2-ENTERPRISE AP needs more than 26 KB memory, please ensure enough space (system_get_free_heap_size). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <WiFiClientSecure.h> | |
#include <PubSubClient.h> | |
#include <ESP8266mDNS.h> | |
#include <WiFiUdp.h> | |
#include <ArduinoOTA.h> | |
#include "/usr/local/src/ap_setting.h" | |
#define DEBUG_PRINT 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
system_rtc_mem_write | |
Function: | |
During deep sleep, only RTC still working, so maybe we need to save some user data in RTC memory. | |
Only user data area can be used by user. | |
|<--------system data--------->|<-----------------user data--------------->| | |
| 256 bytes | 512 bytes | | |
Note: | |
RTC memory is 4 bytes aligned for read and write operations. Parameter des_addr means block number(4 bytes per block). |