I’ve been trying to set up RPi to act as both a wireless AP and wifi station simultaneously. I’ve got nothing but errors and bugs so far. I did however find this guide that creates a virtual AP and runs a station on the same card which im okay with (instead of using 2 seperate wifi cards)
Link to guide: https://imti.co/iot-wifi/
I followed the steps and everything seems to connect, the only problem is I am not receiving an internet connection on the device that connects to the AP of the RPi. I have made sure that the Pi does have acces to internet when its connected to the external network. The aim of my project is to connect the user to the internet through it to the outside network.
Rpi3B+ Stretch9 WiFi Station + AP IOT Hotspot Docker Setting Up Problem
The OP’s setup involving docker is a bit complicated. I need to do much research before I can duplicate his setup and tried to find the problem.
I have heard about the Docker thing for some time, but I have never tried it. Just now I skimmed the wikipedia and guess that it is sort light weight and therefore space/time/process efficient virtual machine thing like the very old guy System 360 VM. Microsoft also has similar light virtualization stuff. Perhaps I start learning by doing, sort of MIT style …
One thing I don’t understand is why the Wifi called “IOT WiFi”. Anyway, I think I can start messing around without understanding everything. I am a huge fan of Oliver Heaviside. I always remember him saying the following:
Am I to refuse to eat because I do not fully understand the mechanism of digestion? – Heaviside
/ to continue, …
Engineering Experimentation Notes
- Rpi3 WiFi Station + AP IOT hotspot based configuration API – Craig Johnston 2018mar15
- About Craig Johnston
- Rpi3 As Wireless Client And Wireless AP – Raspberry Pi forum thread
- Tutorial on Setting up a Raspberry Pi as a WiFi access point – Adafruit
- How to connect to a WPA/WPA2 WiFi network using Linux command line – linuxcommando
- Automatically connect a Raspberry Pi to a Wifi network – weWorkWePlay
- Docker – Wikipedia
- Go – Wikipedia
- Virtualisation – Wikipedia
Appendix A – WiFi Station + AP IOT HotsSpot (Craig Johnston) Learning Notes
IOT Wifi is very small/8MB Docker Container built for the Raspberry Pi 3. IOT Wifi exposes a simple JSON based REST API for controlling the wireless network interface. This container allows the Raspberry Pi to accept wifi connections as an access point (aka AP) while at the same time connecting to an existing wifi network (station mode).
Go (Golang) was used to develop the main application code, to produce a minimal docker image with great performance. The container runs Alpine Linux with small, optimized versions of hostapd, wpa_supplicant and dnsmasq, controlled by the container’s API endpoints.
Appendix B – Docker – Wikipedia Learning Notes
Docker is a set of coupled software-as-a-service and platform-as-a-service products that use operating-system-level virtualization to develop and deliver software in packages called containers. The software that hosts the containers is called Docker Engine.
Containers are isolated from each other and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels. All containers are run by a single operating-system kernel and are thus more lightweight than virtual machines. Containers are created from images that specify their precise contents.
Appendix C – Virtualization – Wikipedia Learning Notes
OS-level virtualization refers to an operating system paradigm in which the kernel allows the existence of multiple isolated user-space instances. Such instances, called containers … may look like real computers from the point of view of programs running in them. A computer program running on an ordinary operating system can see all resources (connected devices, files and folders, network shares, CPU power, quantifiable hardware capabilities) of that computer. However, programs running inside of a container can only see the container’s contents and devices assigned to the container.
On ordinary operating systems for personal computers [tlfong01 – Rpi included?], a computer program can see (even though it might not be able to access) all the system’s resources. They include:
Hardware capabilities, such as the CPU and the network connection Data that can be read or written, such as files, folders and network shares Connected peripherals it can interact with, such as webcam, printer, scanner, or fax
With operating-system-virtualization, or containerization, it is possible to run programs within containers, to which only parts of these resources are allocated.
Appendix D – Go Wikipedia Learning Notes
Go, also known as Golang, is a statically typed, compiled programming language designed at Google. Go is syntactically similar to C, but with memory safety, garbage collection, structural typing, and CSP-style concurrency.
Go was designed at Google in 2007 to improve programming productivity in an era of multicore, networked machines and large codebases. The designers wanted to address criticism of other languages in use at Google, but keep their useful characteristics:
Static typing and run-time efficiency (like C++)
High-performance networking and multiprocessing
The designers were primarily motivated by their shared dislike of C++.
Go is influenced by C
Distinctive approaches to particular problems:
Built-in concurrency primitives: light-weight processes, channels, and the select statement.
An interface system in place of virtual inheritance, and type embedding instead of non-virtual inheritance.
A desire to keep the language specification simple enough to hold in a programmer’s head, in part by omitting features which are common in similar languages.
Go’s syntax includes changes from C aimed at keeping code concise and readable.
Go has a number of built-in types, … Record types can be defined with the struct keyword.
Pointers are available for all types,
For a pair of types K, V, the type map[K]V is the type of hash tables mapping are built into the language
Go provides two features that replace class inheritance: embedding, which can be viewed as an automated form of composition or delegation, interfaces, which provides runtime polymorphism.
In Go’s package system, each package has a path and a name
The Go language has built-in facilities, as well as library support, for writing concurrent programs. Concurrency refers not only to CPU parallelism, but also to asynchrony: letting slow operations like a database or network-read run while the program does other work, as is common in event-based servers.
Go’s concurrency can be used to program shared memory multi-processor machines.
/ to continue, …