Here's my situation:
I am using a Raspberry Pi to control a system. I want to allow the system to be changed over the internet as well as locally. My current plan for controlling it locally is to connect a laptop to it in some way in order to adjust settings.
I have found that it is possible to create an ad-hoc wireless network with the pi. https://spin.atomicobject.com/2013/04/22/raspberry-pi-wireless-communication/
This sounded like the ideal solution for local control because then one could change the system locally using virtually anything with wifi.
So, I tried hooking up two wifi dongles (both Edimax) and configure them so that one can connect to a wifi network and the other can be responsible for the ad-hoc wireless network. However, there appears to be some issues with this. While I can connect to a wireless network, the ad-hoc network only appears in my laptop's list of wireless connections sporadically. When only hooking up one wifi dongle and configuring it to be an ad-hoc network, the ad-hoc network appears in my laptop's list of wireless connections more consistently.
Has anyone tried something like this before and succeeded? Even if I did manage to do this, I don't know how I would differentiate between them in the program sending/receiving things over those connections. Is using two dongles even possible with the Pi's hardware?
Edit per comments:
I'm currently powering the pi with my laptop USB port. I'll give it a try with my phone charger in a couple hours. Also, this is a Raspberry pi 2 with four USB ports so I am not using a hub....they are plugged directly in.
To clarify, I want the program on the Pi to:
- Be able to send/receive info from the ad-hoc network using wifi dongle 1(to allow for a computer to connect to it directly and control the device)
- Be able to send/receive info from the internet using wifi dongle 2 (to allow the device to be controlled remotely over the internet)
- The most likely candidate for doing all of this at the moment is nod.js
Here is my current /etc/network/interfaces file:
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto eth0
allow-hotplug eth0
iface eth0 inet manual
auto wlan0
iface wlan0 inet static
address 192.168.1.1
netmask 255.255.255.0
wireless-channel 1
wireless-essid RPiAdHocNetwork
wireless-mode ad-hoc
auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf