| ESP32 IO PIN | Function | Direction | BME280 | BQ27441-G1 | Comment |
|---|---|---|---|---|---|
| 13 | Application Push button 1 | IN | N/A | N/A | Pull down push button |
| 15 | LED Green | OUT | N/A | N/A | LED |
| 16 | LED RED | OUT | N/A | N/A | LED |
| 26 | SCL | OUT | PAD 4 | PIN 2 | I2C |
| 27 | SDA | OUT | PAD 3 | PIN 1 | I2C |
| 21 | GPOUT | IN | N/A | PIN 12 | This open-drain output can be configured to indicate BAT_LOW |
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
| server { | |
| listen 443 ssl; | |
| listen [::]:443 ssl; | |
| root /home/sudi/code/himinds-boosting-innovation-web-secure-cra/hn-app/build; | |
| index index.html index.htm; | |
| server_name MY_DOMAIN; | |
| ssl_certificate /home/sudi/certbot/etc/live/MY_DOMAIN/fullchain.pem; | |
| ssl_certificate_key /home/sudi/certbot/etc/live/MY_DOMAIN/privkey.pem; | |
| location ~* \.(?:manifest|appcache|html?|xml|json)$ { |
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
| // Imports the Google Cloud client library | |
| const {BigQuery} = require('@google-cloud/bigquery'); | |
| // Your Google Cloud Platform project ID | |
| const projectId = 'bigquery-242619'; | |
| const datasetId = "test_data"; | |
| const tableId = "raw_data"; | |
| const bqTimestamp = BigQuery.timestamp(new Date()); |
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
| config_schema: | |
| - ["i2c.enable", true] | |
| - ["i2c.scl_gpio", 26] | |
| - ["i2c.sda_gpio", 27] | |
| - ["wifi.ap.enable", false] | |
| - ["wifi.sta.enable", true] | |
| - ["wifi.sta.ssid", "YOUR-SSID"] | |
| - ["wifi.sta.pass", "YOUR-PASSKEY"] | |
| - ["mqtt.server", "YOUR-BROKER-IP:8883"] | |
| - ["mqtt.enable", true] |
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
| pid_file /var/run/mosquitto.pid | |
| persistence true | |
| persistence_location /var/lib/mosquitto/ | |
| log_dest file /var/log/mosquitto/mosquitto.log | |
| listener 8883 | |
| cafile /etc/mosquitto/certs/ca.crt | |
| certfile /etc/mosquitto/certs/server.crt |
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
| #!/bin/bash | |
| IP="192.168.1.22" | |
| SUBJECT_CA="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=CA/CN=$IP" | |
| SUBJECT_SERVER="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=Server/CN=$IP" | |
| SUBJECT_CLIENT="/C=SE/ST=Stockholm/L=Stockholm/O=himinds/OU=Client/CN=$IP" | |
| function generate_CA () { | |
| echo "$SUBJECT_CA" | |
| openssl req -x509 -nodes -sha256 -newkey rsa:2048 -subj "$SUBJECT_CA" -days 365 -keyout ca.key -out ca.crt |
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
| std::unique_ptr < CommBase > CommFactory::create() { | |
| bool isEmulator = android::base::GetBoolProperty("ro.kernel.qemu", false); | |
| if (isEmulator) { | |
| // return std::make_unique<PipeComm>(); | |
| return std::make_unique < SocketComm > (); | |
| } else { | |
| // return std::make_unique<SocketComm>(); | |
| return std::make_unique < PipeComm > (); | |
| } | |
| } |
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
| CC=gcc # gcc || clang | |
| CCOPTIONS = -g -Wall | |
| LIBS = -lmosquitto#-ljson-c | |
| all: mosquitto-demo.o | |
| $(CC) -o mosquitto-demo mosquitto-demo.o $(LIBS) $(CCOPTIONS) |
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
| import obd | |
| connection = obd.OBD("/dev/rfcomm0") | |
| cmd = obd.commands.RPM | |
| response = connection.query(cmd) | |
| print(response.value) | |
| print(connection.protocol_name()) |
[Feb 13 20:51:19.925] mgos_app_init c-code dual core ver 0.1
[Feb 13 20:51:19.925] mgos_app_init CPU Speed: 240
[Feb 13 20:51:19.925] mgos_app_init Interrupt attached
[Feb 13 20:51:21.942] task_toggle_led core: 1task_other_core
[Feb 13 20:51:21.942] mgos_app_init core: 0app_init done
[Feb 13 20:51:21.942]
[Feb 13 20:51:21.942] mgos_init Init done, RAM: 307692 total, 267056 free, 267056 min free
[Feb 13 20:51:22.934] mongoose_poll New heap free LWM: 267016
[Feb 13 20:51:26.005] interupt_handler_gpi core: 0