Uncategorized

Docker AP

1

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.

Any suggestions?

 New contributor
  • Ah, let me see. So you have followed the IMTI’s instructions and find everything OK (using only one wifi card). The problem arises only when you start using 2 separate wifi cards. I have two questions: (1) Does IMIT allow you to use 2 wifi cards? (2) If IMIT does not say if two cards are allowed. Did you make any changes to the IMTI’s instructions to cater for two cards? – tlfong01 yesterday   
  • 1
    Any question which boils down to “I followed a tutorial and it doesn’t work” means either you didn’t follow the tutorial or it doesn’t work. – Milliways yesterday
  • @user105104, I browsed IMIT’s documents and found them very impressive. I have no experience in the Docker thing. I am going to learn it, and only afterwards I can be confident to try to reproduce your situation. There are other things you may like to let us know, say what is your stretch version? wifi card spec? – tlfong01 yesterday   
  • There seems some confusion. I thought I saw your answer but no longer found it. You seemed to have mentioned two network cards and I commented, but all disappeared. Anyway, I tried again. I do sometimes use two “network cards”. Actually one is the wift controller built into Rpi3. Another card is actually a USB wifi dongle inserted into the Rpi’s USB socket. If I remember correctly, Raspbian will automatically switch to the USB wifi dongle. In other words, you CANNOT use two “network cards” (one built in, the other USB Wifi dongle) at the same time. But I am still a newbiei, so not sure. – tlfong01 19 hours ago   
  • @tlfong01, yeah the comments seem to be removed. I don’t mind using only one WiFi card. My main problem is that I am not getting internet access on any device I cannot with to the raspberry pi – Zeyad Tarek 19 hours ago
  • What do you mean with “dual network card” to be used with a Raspberry Pi 3? It has a built-in wifi chip and for a second wifi interface you need an USB/wifi dongle. Is it this what you mean?. You can comment your own question. Please address me with @Ingo, otherwise I won’t see your reply. – Ingo 14 hours ago
  • @Zeyad Tarek, I see, so your two network card is a side problem. Your main problem in on the AP part, everything else is OK as the IMTI instructions say. So problem is not yet solved. In this case, I am not going to close the file, but do some study on the newbie scary “Docker” thing (might take a long while! :)”, then come back to reproduce you experiment (except not using NOOBS to start with. – tlfong01 9 hours ago  
  • @user105104, I have completed a rush course in things related to the project (Docker, Go etc). I need to refresh my memory on WiFi station, AP, and IOT, then I should have confidence to try to start reproducing your setup, perhaps tomorrow. – tlfong01 just now   Edit   

0

Question

Rpi3B+ Stretch9 WiFi Station + AP IOT Hotspot Docker Setting Up Problem

Short Answer

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, …

Long Answer

Research Notes

Engineering Experimentation Notes

References

  1. Rpi3 WiFi Station + AP IOT hotspot based configuration API – Craig Johnston 2018mar15
  2. About Craig Johnston
  3. Rpi3 As Wireless Client And Wireless AP – Raspberry Pi forum thread
  4. Tutorial on Setting up a Raspberry Pi as a WiFi access point – Adafruit
  5. How to connect to a WPA/WPA2 WiFi network using Linux command line – linuxcommando
  6. Automatically connect a Raspberry Pi to a Wifi network – weWorkWePlay
  7. Docker – Wikipedia
  8. Go – Wikipedia
  9. Virtualisation – Wikipedia

Appendices

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++)

Readability and usability (like Python or JavaScript)

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, …

.END

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: