A Secure WebSocket Relay can be used to connect to your device over the internet (from anywhere in the world).
Warning
🚧 THIS IS EXPERIMENTAL, BEWARE OF BUGS 🚧
1. Connect ViperIDE to your device using USB
# Set your WiFi network credentials
WIFI_SSID='WiFi_SSID'
WIFI_PASS='WiFi_Password'
import network, time
sta = network.WLAN(network.STA_IF)
if not sta.isconnected():
print('Connecting to WiFi...')
sta.active(True)
sta.connect(WIFI_SSID, WIFI_PASS)
t = time.ticks_ms()
while time.ticks_diff(time.ticks_ms(), t) < 10000:
if sta.isconnected():
break
else:
print('Error: Could not connect to WiFi!')
import wss_repl
wss_repl.start()The device will generate a new random ID on every boot. Most likely, you'll want to have a fixed ID.
This is easy, just take the auto-generated ID and put it into your code like this:
wss_repl.start(uid='YOUR-DEVICE-UID')In the terminal, you should see something like:
Secure WebREPL available on https://viper-ide.org?relay=YOUR-DEVICE-UID
Visit the specified link to open the IDE.
If you're running a relay server, please specify the URL:
wss_repl.start(url='wss://your-server-url')- Use WebREPL button in
ViperIDEto connect to your device - Your device address will look like this:
wss://your-server-url/YOUR-DEVICE-UID