Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions 04_ACCESS_POINT/accesspoint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Code to make the NodeMCU (ESP8266) an access point, so that other devices can connect to it.

import network

ap = network.WLAN(network.AP_IF) # Access point interface, this will be used to make the Node into a hotspot.

ap.active(True) # Activate the Access Point interface.

ap.config(essid="ESSID", password="PASSWORD") # Replace ESSID with the network name, and PASSWORD with the password for other devices to connect.

print(ap.ifconfig()) # Prints (on Terminal) the IP address, netmask, gateway, DNS.

# The following command returns True if devices are connected to the NodeMCU.
# ap_if.active()
12 changes: 12 additions & 0 deletions 04_ACCESS_POINT/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 04_ACCESS_POINT
To run the program use the following ampy command

## MAC OS
```bash
ampy --port /dev/tty.SLAB_USBtoUART run accesspoint.py
```

## Linux
```bash
ampy --port /dev/ttyUSB0 run accesspoint.py
```