espat,wifinina,rtl8720dn: change ssid/pass from const to var

This commit is contained in:
sago35
2022-09-23 12:01:57 +09:00
committed by Ron Evans
parent 4061adf6db
commit 5af2512901
25 changed files with 134 additions and 116 deletions
+5 -4
View File
@@ -6,7 +6,6 @@
//
// More information on the Espressif AT command set at:
// https://www.espressif.com/sites/default/files/documentation/4a-esp8266_at_instruction_set_en.pdf
//
package main
import (
@@ -19,9 +18,11 @@ import (
// change actAsAP to true to act as an access point instead of connecting to one.
const actAsAP = false
// access point info
const ssid = "YOURSSID"
const pass = "YOURPASS"
var (
// access point info
ssid string
pass string
)
// these are the default pins for the Arduino Nano33 IoT.
// change these to connect to a different UART or pins for the ESP8266/ESP32
+5 -4
View File
@@ -3,7 +3,6 @@
//
// In other words:
// Your computer <--> UART0 <--> MCU <--> UART1 <--> ESP8266 <--> INTERNET
//
package main
import (
@@ -17,9 +16,11 @@ import (
// change actAsAP to true to act as an access point instead of connecting to one.
const actAsAP = false
// access point info
const ssid = "YOURSSID"
const pass = "YOURPASS"
var (
// access point info
ssid string
pass string
)
// these are the default pins for the Arduino Nano33 IoT.
// change these to connect to a different UART or pins for the ESP8266/ESP32
+5 -4
View File
@@ -3,7 +3,6 @@
//
// In other words:
// Your computer <--> UART0 <--> MCU <--> UART1 <--> ESP8266
//
package main
import (
@@ -14,9 +13,11 @@ import (
"tinygo.org/x/drivers/net"
)
// access point info
const ssid = "YOURSSID"
const pass = "YOURPASS"
var (
// access point info
ssid string
pass string
)
// IP address of the listener aka "hub". Replace with your own info.
const hubIP = "0.0.0.0"
+6 -5
View File
@@ -7,8 +7,7 @@
//
// You must install the Paho MQTT package to build this program:
//
// go get -u github.com/eclipse/paho.mqtt.golang
//
// go get -u github.com/eclipse/paho.mqtt.golang
package main
import (
@@ -20,9 +19,11 @@ import (
"tinygo.org/x/drivers/net/mqtt"
)
// access point info
const ssid = "YOURSSID"
const pass = "YOURPASS"
var (
// access point info
ssid string
pass string
)
// IP address of the MQTT broker to use. Replace with your own info.
const server = "tcp://test.mosquitto.org:1883"
+6 -5
View File
@@ -7,8 +7,7 @@
//
// You must also install the Paho MQTT package to build this program:
//
// go get -u github.com/eclipse/paho.mqtt.golang
//
// go get -u github.com/eclipse/paho.mqtt.golang
package main
import (
@@ -21,9 +20,11 @@ import (
"tinygo.org/x/drivers/net/mqtt"
)
// access point info
const ssid = "YOURSSID"
const pass = "YOURPASS"
var (
// access point info
ssid string
pass string
)
// IP address of the MQTT broker to use. Replace with your own info.
//const server = "tcp://test.mosquitto.org:1883"
+5 -4
View File
@@ -3,7 +3,6 @@
//
// In other words:
// Your computer <--> UART0 <--> MCU <--> UART1 <--> ESP8266
//
package main
import (
@@ -14,9 +13,11 @@ import (
"tinygo.org/x/drivers/net"
)
// access point info
const ssid = "YOURSSID"
const pass = "YOURPASS"
var (
// access point info
ssid string
pass string
)
// IP address of the server aka "hub". Replace with your own info.
const serverIP = "0.0.0.0"
+6 -6
View File
@@ -29,16 +29,16 @@ import (
// You can override the setting with the init() in another source code.
// func init() {
// ssid = "your-ssid"
// password = "your-password"
// pass = "your-password"
// debug = true
// server = "tinygo.org"
// }
var (
ssid string
password string
server string = "tcp://test.mosquitto.org:1883"
debug = false
ssid string
pass string
server string = "tcp://test.mosquitto.org:1883"
debug = false
)
var buf [0x400]byte
@@ -65,7 +65,7 @@ func run() error {
adaptor.Debug(debug)
adaptor.Configure()
err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second)
err := adaptor.ConnectToAccessPoint(ssid, pass, 10*time.Second)
if err != nil {
return err
}
+6 -6
View File
@@ -30,16 +30,16 @@ import (
// You can override the setting with the init() in another source code.
// func init() {
// ssid = "your-ssid"
// password = "your-password"
// pass = "your-password"
// debug = true
// server = "tinygo.org"
// }
var (
ssid string
password string
server string = "tcp://test.mosquitto.org:1883"
debug = false
ssid string
pass string
server string = "tcp://test.mosquitto.org:1883"
debug = false
)
var buf [0x400]byte
@@ -74,7 +74,7 @@ func run() error {
adaptor.Debug(debug)
adaptor.Configure()
err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second)
err := adaptor.ConnectToAccessPoint(ssid, pass, 10*time.Second)
if err != nil {
return err
}
+6 -6
View File
@@ -19,16 +19,16 @@ import (
// You can override the setting with the init() in another source code.
// func init() {
// ssid = "your-ssid"
// password = "your-password"
// pass = "your-password"
// ntpHost = "129.6.15.29"
// debug = true
// }
var (
ssid string
password string
ntpHost = "129.6.15.29"
debug = false
ssid string
pass string
ntpHost = "129.6.15.29"
debug = false
)
const NTP_PACKET_SIZE = 48
@@ -48,7 +48,7 @@ func run() error {
adaptor.Debug(debug)
adaptor.Configure()
err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second)
err := adaptor.ConnectToAccessPoint(ssid, pass, 10*time.Second)
if err != nil {
return err
}
+3 -3
View File
@@ -20,14 +20,14 @@ import (
// You can override the setting with the init() in another source code.
// func init() {
// ssid = "your-ssid"
// password = "your-password"
// pass = "your-password"
// serverIP = "192.168.1.119"
// debug = true
// }
var (
ssid string
password string
pass string
serverIP = ""
debug = false
)
@@ -47,7 +47,7 @@ func run() error {
adaptor.Debug(debug)
adaptor.Configure()
err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second)
err := adaptor.ConnectToAccessPoint(ssid, pass, 10*time.Second)
if err != nil {
return err
}
+6 -6
View File
@@ -16,17 +16,17 @@ import (
// You can override the setting with the init() in another source code.
// func init() {
// ssid = "your-ssid"
// password = "your-password"
// pass = "your-password"
// debug = true
// url = "https://www.example.com"
// test_root_ca = "..."
// }
var (
ssid string
password string
url string = "https://www.example.com"
debug = false
ssid string
pass string
url string = "https://www.example.com"
debug = false
)
// Set the test_root_ca created by the following command
@@ -76,7 +76,7 @@ func run() error {
adaptor.SetRootCA(&test_root_ca)
http.SetBuf(buf[:])
err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second)
err := adaptor.ConnectToAccessPoint(ssid, pass, 10*time.Second)
if err != nil {
return err
}
+6 -6
View File
@@ -16,16 +16,16 @@ import (
// You can override the setting with the init() in another source code.
// func init() {
// ssid = "your-ssid"
// password = "your-password"
// pass = "your-password"
// hubIP = "192.168.1.118"
// debug = true
// }
var (
ssid string
password string
hubIP = ""
debug = false
ssid string
pass string
hubIP = ""
debug = false
)
var buf [0x400]byte
@@ -45,7 +45,7 @@ func run() error {
http.SetBuf(buf[:])
err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second)
err := adaptor.ConnectToAccessPoint(ssid, pass, 10*time.Second)
if err != nil {
return err
}
@@ -21,16 +21,16 @@ import (
// If debug is enabled, a serial connection is required.
// func init() {
// ssid = "your-ssid"
// password = "your-password"
// pass = "your-password"
// debug = false // true
// server = "tinygo.org"
// }
var (
ssid string
password string
url = "http://tinygo.org/"
debug = false
ssid string
pass string
url = "http://tinygo.org/"
debug = false
)
var (
@@ -88,7 +88,7 @@ func run() error {
http.SetBuf(buf[:])
fmt.Fprintf(terminal, "ConnectToAP()\r\n")
err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second)
err := adaptor.ConnectToAccessPoint(ssid, pass, 10*time.Second)
if err != nil {
return err
}
+6 -6
View File
@@ -15,16 +15,16 @@ import (
// You can override the setting with the init() in another source code.
// func init() {
// ssid = "your-ssid"
// password = "your-password"
// pass = "your-password"
// url = "http://tinygo.org/"
// debug = true
// }
var (
ssid string
password string
url = "http://tinygo.org/"
debug = false
ssid string
pass string
url = "http://tinygo.org/"
debug = false
)
var buf [0x400]byte
@@ -45,7 +45,7 @@ func run() error {
http.UseDriver(adaptor)
http.SetBuf(buf[:])
err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second)
err := adaptor.ConnectToAccessPoint(ssid, pass, 10*time.Second)
if err != nil {
return err
}
+5 -5
View File
@@ -13,14 +13,14 @@ import (
// You can override the setting with the init() in another source code.
// func init() {
// ssid = "your-ssid"
// password = "your-password"
// pass = "your-password"
// debug = true
// }
var (
ssid string
password string
debug = false
ssid string
pass string
debug = false
)
var led = machine.LED
@@ -44,7 +44,7 @@ func run() error {
http.UseDriver(adaptor)
err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second)
err := adaptor.ConnectToAccessPoint(ssid, pass, 10*time.Second)
if err != nil {
return err
}
+5 -4
View File
@@ -4,7 +4,6 @@
// You can open a server to accept connections from this program using:
//
// nc -w 5 -lk 8080
//
package main
import (
@@ -15,9 +14,11 @@ import (
"tinygo.org/x/drivers/net"
)
// access point info
const ssid = ""
const pass = ""
var (
// access point info
ssid string
pass string
)
// IP address of the server aka "hub". Replace with your own info.
const serverIP = ""
+5 -3
View File
@@ -9,9 +9,11 @@ import (
"tinygo.org/x/drivers/wifinina"
)
// access point info
const ssid = ""
const pass = ""
var (
// access point info
ssid string
pass string
)
// these are the default pins for the Arduino Nano33 IoT.
// change these to connect to a different UART or pins for the ESP8266/ESP32
+5 -4
View File
@@ -9,7 +9,6 @@
//
// examples/wifinina/webclient
// examples/wifinina/tlsclient
//
package main
import (
@@ -24,9 +23,11 @@ import (
"tinygo.org/x/drivers/wifinina"
)
// access point info
const ssid = ""
const pass = ""
var (
// access point info
ssid string
pass string
)
// IP address of the server aka "hub". Replace with your own info.
// Can specify a URL starting with http or https
+6 -5
View File
@@ -7,8 +7,7 @@
//
// You must install the Paho MQTT package to build this program:
//
// go get -u github.com/eclipse/paho.mqtt.golang
//
// go get -u github.com/eclipse/paho.mqtt.golang
package main
import (
@@ -21,9 +20,11 @@ import (
"tinygo.org/x/drivers/wifinina"
)
// access point info
const ssid = ""
const pass = ""
var (
// access point info
ssid string
pass string
)
// IP address of the MQTT broker to use. Replace with your own info.
const server = "tcp://test.mosquitto.org:1883"
+6 -5
View File
@@ -7,8 +7,7 @@
//
// You must also install the Paho MQTT package to build this program:
//
// go get -u github.com/eclipse/paho.mqtt.golang
//
// go get -u github.com/eclipse/paho.mqtt.golang
package main
import (
@@ -21,9 +20,11 @@ import (
"tinygo.org/x/drivers/wifinina"
)
// access point info
const ssid = ""
const pass = ""
var (
// access point info
ssid string
pass string
)
// IP address of the MQTT broker to use. Replace with your own info.
const server = "tcp://test.mosquitto.org:1883"
+5 -3
View File
@@ -14,9 +14,11 @@ import (
"tinygo.org/x/drivers/wifinina"
)
// access point info
const ssid = ""
const pass = ""
var (
// access point info
ssid string
pass string
)
// IP address of the server aka "hub". Replace with your own info.
const ntpHost = "129.6.15.29"
+5 -4
View File
@@ -4,7 +4,6 @@
// You can open a server to accept connections from this program using:
//
// nc -w 5 -lk 8080
//
package main
import (
@@ -17,9 +16,11 @@ import (
"tinygo.org/x/drivers/wifinina"
)
// access point info
const ssid = ""
const pass = ""
var (
// access point info
ssid string
pass string
)
// IP address of the server aka "hub". Replace with your own info.
const serverIP = ""
+5 -4
View File
@@ -4,7 +4,6 @@
// You shall see "strict-transport-security" header in the response,
// this confirms communication is indeed over HTTPS
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
//
package main
import (
@@ -18,9 +17,11 @@ import (
"tinygo.org/x/drivers/wifinina"
)
// access point info
const ssid = ""
const pass = ""
var (
// access point info
ssid string
pass string
)
// IP address of the server aka "hub". Replace with your own info.
const server = "tinygo.org"
+5 -4
View File
@@ -3,7 +3,6 @@
//
// In other words:
// Your computer <--> UART0 <--> MCU <--> SPI <--> ESP32
//
package main
import (
@@ -15,9 +14,11 @@ import (
"tinygo.org/x/drivers/wifinina"
)
// access point info
const ssid = ""
const pass = ""
var (
// access point info
ssid string
pass string
)
// IP address of the server aka "hub". Replace with your own info.
const hubIP = ""
+5 -4
View File
@@ -3,7 +3,6 @@
// Arduino example:
//
// https://github.com/arduino-libraries/WiFiNINA/blob/master/examples/WiFiWebClientRepeating/
//
package main
import (
@@ -15,9 +14,11 @@ import (
"tinygo.org/x/drivers/wifinina"
)
// access point info
const ssid = ""
const pass = ""
var (
// access point info
ssid string
pass string
)
// IP address of the server aka "hub". Replace with your own info.
const server = "tinygo.org"