[IoT EDGE V.3 Board] Ethernet (RJ45) Build in on Board Communication Test.

Supphakarin Phoruangrong
3 min readMay 11, 2021

--

Device

  • IoT EDGE V.3 Board
  • MLX90614
  • Mobile Phone

Software

Library for Arduino IDE

Model Test

  • IoT EDGE V.3 Board’s read temp transfer data to Blynk server.
  • Blynk Server keep data and command for Device
  • Device (Mobile Phone) monitoring and Control IoT EDGE V.3

Source Code

  • IoT EDGE V.3 Ethernet → Blynk Server (Download)

Explain

ในการทดสอบการใช้งานบอร์ด IoT EAGE V.3 ในบทความนี้ความจะทดสอบการสื่อสารแบบ Ethernet ใช้สาย RJ45 ซึ่งจะคล้ายกับการ เชื่อต่อแบบ Wi-Fi โดยเราจะใช้คู่กับ Blynk Server IoT เป็นตัวเก็บรับและส่งข้อมูลให้กับ Mobile Phone และ Controller เราจะทำการส่งค่า Temp. ให้กับ Server แล้วรับค่า มาเปิด-ปิด LED Build in และส่วนของ Mobile จะแสดงค่า Temp โดยจะดึงข้อมูลมาจาก Server

Method

  1. สมัครการใช้งาน Blynk ผ่าน App บนมือถือ โดยจะใช้ Gmail หรือ Facebook (ต้องสามารถเปิด E-Mail ได้ เพราะ Token การใช้งานจะถูกส่งผ่านทาง E-Mail)

Create New Account → กรอก Email / Password → กด Sign Up

2.สร้าง New Project → ตั้งชื่อ Project →เลือก Board ในที่นี้เราจะเลือกเป็น ESP32 DEV → กด OK → การเชื่อต่อเป็นแบบ Ethernet →กด Create

3.เพิ่ม Monitoring และ Control กดเครื่องหมาย + →เพิ่ม Button →Gauge →Super Chart

4.Set Monitoring and Control ที่นำมาวางบน workspace

  • Set Gauge/ INPUT เป็น V1 0–100 / LABEL (/pin.##/C) /READING TATE

1 sec

  • Set Supper Chart กด Add Data stream /INPUT V1 / #.##/
  • Set Styled Button /INPUT Digital gp 2/

5.เขียน Code โดย Token นำมาจาก Email ที่ Blynk ส่งให้
ssid ชื่อ Wifi / Pass รหัสWifi /auth Token

#define BLYNK_PRINT Serial
#include <Wire.h>
#include "MLX90614.h"
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
esl::MLX90614 mlx90614;
char auth[] = "TOKEN_FROM_EMAIL";#define MKRETH_CS 5
#define SDCARD_CS 4
void setup()
{
// Debug console
Serial.begin(115200);
pinMode(SDCARD_CS, OUTPUT);
digitalWrite(SDCARD_CS, HIGH);
Ethernet.init(MKRETH_CS);
Blynk.begin(auth);

while (!Serial) ;
Wire.begin();
mlx90614.init( );
Serial.print( "Address = 0x" );
Serial.println( mlx90614.readSlaveAddress(), HEX );
pinMode(2,OUTPUT);
}
void loop()
{
float f;
Serial.print( "Ambient temp. (Ta): " );
f = mlx90614.readAmbientTemperature();
if ( !mlx90614.is_crc_error() ) {
Serial.println(f);
Blynk.virtualWrite(V1,f);
}
Blynk.run();
}

6. ทำการ Upload Program ลง IoT EDGE V.3

7.เปิด App Blynk แล้วกดเริ่มการทำงาน ▶ มุมบนขวา แล้วดูผลการทำงาน

Reference

สอนใช้งาน NodeMCU Wifi Blynk Gauge แสดงค่าอุณหภูมิและความชื้น DHT11 ผ่าน WiFi — ขาย Arduino อุปกรณ์ Arduino คุณภาพดี ราคาถูก ส่งไว ส่งฟรี : Inspired by LnwShop.com (myarduino.net)

Blynk IoT platform: for businesses and developers

งานครั้งที่ 29 [iot#4 Blynk] การแสดงสถานะ LED บนแอฟ Blynk จากบอร์ดทดลอง (praphas.com)

--

--

No responses yet