Y. Chainsan
a language, a world.
×

Record my voice

Sign In
Email:
Password:
Captcha:
Archive
A Wemos D1 Mini board based on ESP8266-EX MCU was used at this expriment. The dev board looks like this Target This demo just shows how an ESP8266 device can communicate with remote server. So my local PC is used as server host in dev environment. In the next phase, I'll move the server to a cloud host like Aliyun. Client Side The IDE is arduino, full code pasted as following. /* This sketch establishes a TCP connection to a "quote of the day" service. It sends a "hello" message, and then prints received data. */ #include <ESP8266WiFi.h> #ifndef STASSID #define STASSID "@PHICOMM_10" #define STAPSK "ilovegod2016!" #endif const char* ssid = STASSID; const char* password = STAPSK; const char* host = "djxmmx.net"; const uint16_t port = 17; void setup() { Serial.begin(115200); // We start by connecting to a WiFi network Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid); /* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default, would try to act as both a client and an access-point and could cause network-issues with your other WiFi-devices on your WiFi-network. */ WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP()); } void loop() { Serial.print("connecting to "); Serial.print(host); Serial.print(':'); Serial.println(port); // Use WiFiClient class to create TCP connections WiFiClient client; if (!client.connect(host, port)) { Serial.println("connec
2019-11-22 0 1
0
In the scenario of using docker to implement microservice architecture projects, each microservice needs to be deployed separately, which may increase the complexity and time of overall project deployment dramatically. The following contents is a solution to this issue based on real project in the company I'm working at. From installation of docker to testing and verifying of the project, this deployment practice of 9-steps makes a minimun system ready for use. STEP 1- Install docker, set storage path, set project network ### Install Docker  # 1. update yum packages  sudo yum update  # 2. install dependencies, yum-util has yum-config-manager ability, the other two for devicemapper  sudo yum install -y yum-utils device-mapper-persistent-data lvm2  # 3. set yum repo  sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo  # 4. check all docker versions in the repo, and choose proper version  yum list docker-ce --showduplicates | sort -r  # 5. install docker  sudo yum install docker-ce-18.06.3.ce  # 6. start and make auto start by booting  sudo systemctl start docker  sudo systemctl enable docker  # 7. verify installation (with both client and server section means docker has been installed successfully)  docker -v  sudo docker version     Client:      Version:           18.06.3-ce      API version:       1.38      Go version:        go1.10.3      Git commit:        d7080c1      Built:             Wed Feb 20 02:26:51 2019
2019-06-13 0 138