Everything is Talkative: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
|||
Zeile 9: | Zeile 9: | ||
== ELECTRICITY LAYER == | == ELECTRICITY LAYER == | ||
=== ON / OFF === | === ON / OFF === | ||
Binary: | |||
0,1 | |||
HIGH, LOW | |||
ON, OFF | |||
0V, 5V | |||
GND, VCC | |||
=== BINARY ENCODING, 8BIT/1BYTE === | === BINARY ENCODING, 8BIT/1BYTE === | ||
2^8=256 | 2^8=256 | ||
=== ASCII | ==== ASCII ==== | ||
American Standard Code for Information Interchange | |||
==== UNICODE ==== | |||
https://live.staticflickr.com/65535/51107648386_c8811ce95e_c.jpg | https://live.staticflickr.com/65535/51107648386_c8811ce95e_c.jpg | ||
Zeile 18: | Zeile 27: | ||
== HARDWARE LAYER == | == HARDWARE LAYER == | ||
=== PARALLEL === | === PARALLEL === | ||
DB-25 | |||
https://live.staticflickr.com/65535/51107072372_a9693d8f1f_c.jpg | https://live.staticflickr.com/65535/51107072372_a9693d8f1f_c.jpg | ||
=== SERIAL === | === SERIAL === | ||
RS232: Recomended Standard | |||
USB: Universal Serial Bus | |||
https://live.staticflickr.com/65535/51107392694_ddf8a54b29_c.jpg | https://live.staticflickr.com/65535/51107392694_ddf8a54b29_c.jpg | ||
Zeile 29: | Zeile 41: | ||
== TRANSPORT LAYER == | == TRANSPORT LAYER == | ||
=== NETWORK, LAN, IP === | === NETWORK, LAN, IP === | ||
IP: Internet Protocol | |||
LAN: Local Area Network | |||
Ethernet | |||
https://live.staticflickr.com/65535/51107649681_30924fff2d_c.jpg | https://live.staticflickr.com/65535/51107649681_30924fff2d_c.jpg | ||
https://live.staticflickr.com/65535/51107649946_8bc206738f_c.jpg | https://live.staticflickr.com/65535/51107649946_8bc206738f_c.jpg | ||
Zeile 34: | Zeile 49: | ||
=== UDP (SEND MODEL) === | === UDP (SEND MODEL) === | ||
User Datagram Protocol | |||
=== TCP (CONNECT, SEND, RECEIVE MODEL) === | === TCP (CONNECT, SEND, RECEIVE MODEL) === | ||
Transmission Control Protocol | |||
== ENCODING LAYER == | == ENCODING LAYER == | ||
=== OSC (ADDRESS MODEL) === | === OSC (ADDRESS MODEL) === | ||
Open Sound Control | |||
=== HID === | |||
Human Interface Device | |||
== PUBLISH <-> SUBSCRIBE MODEL == | == PUBLISH <-> SUBSCRIBE MODEL == | ||
=== MQTT === | === MQTT === | ||
MQTT: Message Queuing Telemetry Transport | |||
https://live.staticflickr.com/65535/49856212336_cf2c240d1e_c.jpg | https://live.staticflickr.com/65535/49856212336_cf2c240d1e_c.jpg | ||
https://live.staticflickr.com/65535/49856212466_3997636a84_c.jpg | https://live.staticflickr.com/65535/49856212466_3997636a84_c.jpg | ||
https://live.staticflickr.com/65535/51108424240_08b766bdc7_c.jpg | https://live.staticflickr.com/65535/51108424240_08b766bdc7_c.jpg | ||
= examples = | |||
== ARDUINO Uno / Flora <-- Serial --> PROCESSING == | |||
== PROCESSING <-- OSC --> PROCESSING == | |||
== PROCESSING <-- MQTT(shiftr.io) --> PROCESSING == | |||
=== PROCESSING MQTT INSTALL === | |||
follow these instructions to install the MQTT Processing library: | |||
1) in the Processing top menu go to: | |||
“Sketch” –> “Import Library” –> “Import Library” | |||
2) type “MQTT” in the search box | |||
3) select the MQTT library by Joel Gaehwiler | |||
4) click on “Install” | |||
DONE! | |||
== ARDUINO ESP32 <-- MQTT(shiftr.io) --> PROCESSING == | |||
=== ARDUINO ESP32 INSTALL === | |||
follow these instructions to install the ESP32 Arduino library: | |||
1 | |||
Menu: Preferences —> Additional Boards Manager URLs: | |||
https://dl.espressif.com/dl/package_esp32_index.json | |||
2 | |||
Menu: Tools —> Boards —> Boards Manager: | |||
search for: “ESP32” | |||
Install: “esp32 by Espressif Systems” | |||
3 | |||
Menu: Tools —> Board: ESP32 Dev Module | |||
Menu: Tools —> Port: dev/cu… | |||
(unplug and plug to see which port appears) | |||
Menu: Tools —> Flash Mode: QIO | |||
Menu: Tools —> Flash Size: 4MB | |||
Menu: Tools —> Flash Frequency: 80Mhz | |||
Menu: Tools —> Upload Speed: 115200 | |||
=== ARDUINO MQTT INSTALL === | |||
1 Menu: Sketch —> Include Library —> Manage Libraries | |||
2 search for: “MQTT” | |||
3 Install: MQTT library for Arduino | |||
by Joel Gaehwiler | |||
=== TEST: ESP ARDUINO CONNECTION === | |||
Menu: File —> Examples —> Basics —> “Blink” | |||
edit: LED_PIN = 2; | |||
—> blue LED should blink on/off | |||
=== TEST: ESP SENSOR CONNECTION === | |||
READ ANALOG SENSOR | |||
Menu: File —> Examples —> Communication —> “Graph” | |||
edit: Serial.begin(115200); | |||
edit: pick a GPIO pin with and ADC | |||
(GPIO = General Purpose In Out) | |||
(ADC = Analog Digital Converter) | |||
for example: analogRead(34); | |||
Note: ADC2 pins cannot be used when Wi-Fi is used. So, if you’re using Wi-Fi and you’re having trouble getting the value from an ADC2 GPIO, you may consider using an ADC1 GPIO instead, that should solve your problem. | |||
=== SEND: SENSORDATA OVER MQTT === | |||
Menu: File —> Examples —> MQTT —> ESP32DevelopmentBoard | |||
edit: your wifi info: | |||
your network name / SIID | |||
(SIID = Service Set Identifier) | |||
your password | |||
edit: the “ClientID” so that you can see yourself connect: | |||
client.connect(“ClientID”, “try”, “try”) | |||
edit: the topics you subscribe and publish to by adding “/yourName” | |||
you can also change the “message” you are sending! | |||
client.subscribe(“/hello/yourName”); | |||
client.publish(“/hello/yourName”, “message”); |
Version vom 10. April 2021, 22:12 Uhr
We like to embed electronics in everything these days, and while we’re at it why not include wifi so that everything can communicate with everything via The Internet.
introduction to networks
how things are talking with each-other using electricity
ELECTRICITY LAYER
ON / OFF
Binary: 0,1 HIGH, LOW ON, OFF 0V, 5V GND, VCC
BINARY ENCODING, 8BIT/1BYTE
2^8=256
ASCII
American Standard Code for Information Interchange
UNICODE
HARDWARE LAYER
PARALLEL
DB-25
SERIAL
RS232: Recomended Standard USB: Universal Serial Bus
ETHERNET
TRANSPORT LAYER
NETWORK, LAN, IP
IP: Internet Protocol LAN: Local Area Network Ethernet
UDP (SEND MODEL)
User Datagram Protocol
TCP (CONNECT, SEND, RECEIVE MODEL)
Transmission Control Protocol
ENCODING LAYER
OSC (ADDRESS MODEL)
Open Sound Control
HID
Human Interface Device
PUBLISH <-> SUBSCRIBE MODEL
MQTT
MQTT: Message Queuing Telemetry Transport
examples
ARDUINO Uno / Flora <-- Serial --> PROCESSING
PROCESSING <-- OSC --> PROCESSING
PROCESSING <-- MQTT(shiftr.io) --> PROCESSING
PROCESSING MQTT INSTALL
follow these instructions to install the MQTT Processing library: 1) in the Processing top menu go to: “Sketch” –> “Import Library” –> “Import Library” 2) type “MQTT” in the search box 3) select the MQTT library by Joel Gaehwiler 4) click on “Install” DONE!
ARDUINO ESP32 <-- MQTT(shiftr.io) --> PROCESSING
ARDUINO ESP32 INSTALL
follow these instructions to install the ESP32 Arduino library: 1 Menu: Preferences —> Additional Boards Manager URLs: https://dl.espressif.com/dl/package_esp32_index.json
2 Menu: Tools —> Boards —> Boards Manager: search for: “ESP32” Install: “esp32 by Espressif Systems”
3 Menu: Tools —> Board: ESP32 Dev Module Menu: Tools —> Port: dev/cu… (unplug and plug to see which port appears) Menu: Tools —> Flash Mode: QIO Menu: Tools —> Flash Size: 4MB Menu: Tools —> Flash Frequency: 80Mhz Menu: Tools —> Upload Speed: 115200
ARDUINO MQTT INSTALL
1 Menu: Sketch —> Include Library —> Manage Libraries 2 search for: “MQTT” 3 Install: MQTT library for Arduino by Joel Gaehwiler
TEST: ESP ARDUINO CONNECTION
Menu: File —> Examples —> Basics —> “Blink” edit: LED_PIN = 2; —> blue LED should blink on/off
TEST: ESP SENSOR CONNECTION
READ ANALOG SENSOR Menu: File —> Examples —> Communication —> “Graph” edit: Serial.begin(115200); edit: pick a GPIO pin with and ADC (GPIO = General Purpose In Out) (ADC = Analog Digital Converter) for example: analogRead(34);
Note: ADC2 pins cannot be used when Wi-Fi is used. So, if you’re using Wi-Fi and you’re having trouble getting the value from an ADC2 GPIO, you may consider using an ADC1 GPIO instead, that should solve your problem.
SEND: SENSORDATA OVER MQTT
Menu: File —> Examples —> MQTT —> ESP32DevelopmentBoard
edit: your wifi info: your network name / SIID (SIID = Service Set Identifier) your password
edit: the “ClientID” so that you can see yourself connect: client.connect(“ClientID”, “try”, “try”)
edit: the topics you subscribe and publish to by adding “/yourName” you can also change the “message” you are sending!
client.subscribe(“/hello/yourName”);
client.publish(“/hello/yourName”, “message”);