Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita072cb3

Browse files
committed
Merge pull requestFirebaseExtended#181 from ed7coyne/disambiguate-serialhost-examples
Disambiguate serialhost examples
2 parents1dc56d8 +bcbcb44 commita072cb3

File tree

10 files changed

+66
-11
lines changed

10 files changed

+66
-11
lines changed

‎examples/FirebaseSerialHost_ESP8266/FirebaseSerialHost_ESP8266.ino

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,9 @@
1818
// A sample that will start our serial transciever listening on a software
1919
// port and allow debug over the main serial port.
2020
//
21-
// A suggested setup for testing this example would be a USB to TTL cable
22-
// with the green wire connected to pin 5 and the white wire connected to
23-
// pin 4 (on the huzzah feather esp8266).
24-
// First edit begin.txt and put in your host and secret.
25-
// Then run the following commands to setup the serial port in linux:
26-
// stty -F /dev/ttyUSB0 9600 raw -echo -echoe -echok
27-
// Then on one console do:
28-
// cat /dev/ttyUSB0 &
29-
// This console will now read all responses from the modem. Then do:
30-
// cat begin.txt > /dev/ttyUSB0
31-
// You should see +OK and you can now feed in the other example commmands.
21+
// A suggested setup for testing this example would be to connect a board
22+
// with integrated usb and open a serial monitor to see debug messages.
23+
// Then connect another board on pin4 and pin5 to communicate over serial.
3224

3325
#include<SoftwareSerial.h>
3426
#include<ESP8266WiFi.h>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
//
2+
// Copyright 2015 Google Inc.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
18+
// A sample that will start our serial transciever listening on the primary
19+
// Serial port.
20+
//
21+
// A suggested setup for testing this example would be a esp8266 with built
22+
// in usb connected.
23+
// First edit begin.txt and put in your host and secret.
24+
// Then run the following commands to setup the serial port (assuming ttyUSB0)
25+
// in linux:
26+
// stty -F /dev/ttyUSB0 9600 raw -echo -echoe -echok
27+
// Then on one console do:
28+
// cat /dev/ttyUSB0 &
29+
// This console will now read all responses from the modem. Then do:
30+
// cat begin.txt > /dev/ttyUSB0
31+
// You should see +OK and you can now feed in the other example commmands.
32+
33+
#include<ESP8266WiFi.h>
34+
35+
#include<Firebase.h>
36+
#include<SerialTransceiver.h>
37+
38+
// Set these to run example.
39+
#defineWIFI_SSID"SSID"
40+
#defineWIFI_PASSWORD"PASSWORD"
41+
42+
firebase::modem::SerialTransceiver transceiver;
43+
44+
voidsetup() {
45+
Serial.begin(9600);
46+
47+
// connect to wifi.
48+
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
49+
Serial.print("connecting");
50+
while (WiFi.status() != WL_CONNECTED) {
51+
Serial.print(".");
52+
delay(500);
53+
}
54+
Serial.println();
55+
Serial.print("connected:");
56+
Serial.println(WiFi.localIP());
57+
58+
transceiver.begin(&Serial);
59+
}
60+
61+
voidloop() {
62+
transceiver.loop();
63+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp