Wifi Dongle
Perhaps solved
I was able to send using netsend in Pd on my desktop to BELA using the IDE. I am still unsure whether this is actually using the wifi dongle or just the USB.
I am now trying to do this powering the BELA without the USB connection.
I have in the User Command Line Arguments:
ifdown wlan0; ifup wlan0
and am running a simple netsend patch with [connect 192.168.7.2 3000( message.
getting Pd error
connecting to port 3000
connecting stream socket: Operation timed out (60)
1) I'm guessing that when it worked previously I was still doing it via the USB?
2) How do I find out the IP address of the Bela? I'm hoping to be able to send to 3 separate ones at a time.
3) Is there something else that I'm missing here?
Thanks for your help so far!!
robin [connect 192.168.7.2 3000(
The 192.168.7.2 is definitely the IP address of the board when connected over USB.
When on the wi-fi network, your board will have a different IP address. If you have access to the router for the wi-fi network, you can check what the IPs are of each of the devices connected. Any half-decent router will allow you to assign a static address to each wi-fi dongle, so that the IP is guaranteed not to change when you reconnect.
Alternatively, you can find the IP from Bela itself: connect over USB and run ip a
. Next to wlan0
, you will see the IP address that the board has on the wi-fi network. While it is likely that the router will re-use the same address next time the same wifi dongle connects to it, there is no guarantee (unless you do as explained above) that it will persist.
You could also try to send messages to the broadcast address of the wifi network (typically xxx.xxx.xxx.255) to attempt automatic discovery, but hopefully the static IP method above will work and it is much easier!
Thank you so much for your help. That all works.
I will now try to get the static IP working but all is good so far!
Told you it was "Solved"!
Everything is very stable. I'm sending to several Belas using Udpsend in MaxMSP directly to Pd on Bela. Super cool.
I think I will buy a small USB TP-LINK TL-WR902AC Wireless Router because I understand that this will work in any venue (when I set up my own network) regardless of the WiFi there. This means that for public work, I could, for example, run this outdoors, or somewhere with no WiFi. Is that correct?
I did try to set up my own WLAN (Yosemite) last night but had issues connecting (one issue was that Yosemite does not allow WPA-keys for ad hoc networks). I did try using wpa-key-mgmt=NONE but didn't have much luck.
Regardless, would you say getting a small router is the safer option here, rather than using an ad hoc network via my laptop alone?
robin one issue was that Yosemite does not allow WPA-keys for ad hoc networks)
seems silly hey? tell me about it!
robin Regardless, would you say getting a small router is the safer option here, rather than using an ad hoc network via my laptop alone?
I am no expert, however check out this paper http://cnmat.org/files/attachments/NIME2014-Making-the-Most-of-Wi-Fi.pdf
giuliomoro
Hi
I am going through the same steps as Robin, but seem to have a dead end with the
ifup wlan0; ifdown wlan0; command.
It results in No DHCPOFFERS received, and then when I run
ip a
wlan0 shows up as
5: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 8c:3b:ad:2f:39:26 brd ff:ff:ff:ff:ff:ff
No IP address as it should have if working. Any ideas what is wrong?
bEst,
Andreas
Did you set the username and password for the wifi as described here ? Sometimes you need to do ifup wlan0
, ifdown wlan0
, ifup wlan0
a couple of times
- Edited
if you did it, can you post the output of cat /etc/wpa_supplicant/wpa_supplicant.conf
?
I tried the ifup wlan; ifdown wlan; several times, and then checked the wpa config file:
network={
ssid="VIBRA_network"
#psk="my_p*****rd"
psk=f4ac1785d3c96383b93b26e76c39862d97fecae0ac36b9468ce8eb903f9c00c3
}
I still don't have an IP, but only:
3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 8c:3b:ad:2f:39:26 brd ff:ff:ff:ff:ff:ff
right. Try to run
iwlist wlan0 scanning
that should return a list of the available networks.
Yes, long list with 32 "Cells". Entries like:
Cell 02 - Address: 00:22:07:4F:AE:16
ESSID:"NextGenTel_AE17"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:on
Bit Rates:144 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020c00
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD7C0050F204104A0001101044000102103B00010310470010EB49E6C9A8BBE97568B118CC59F10CCC1021000842726F6164636F6D1023000842726F6164636F6D1024000631323334353610420004313233341054000800060050F204000110110006496E74656E6F100800022008103C0001011049000600372A000120
Quality=93/100 Signal level=-65 dBm
Extra:fm=0003
Seems to match the list on available networks on my mac fairly well.
So it seems that it is scanning somehow, but still no IP when I do ip a, only
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 8c:3b:ad:2f:39:26 brd ff:ff:ff:ff:ff:ff
is the network you are trying to connect to listed among those?
There is also the possibility that you somehow mistyped the path to /etc/wpa_supplicant/wpa_supplicant.conf
?
So, I haven't tried to connect to anything. I thought that the first step was getting an IP in the list of network devices. But, yes - there are a few of the networks listed that I can connect to.
Does it mean I can connect to them?
If the network you want to connect to is listed there, and you have appropriately set the network name and passphrase in /etc/wpa_supplicant/wpa_supplicant.conf
, and there are no typos involved, then doing ifup wlan0
should try to connect to the network, and, upon success, obtain an IP address.
Another thing to check is that your network router actually has a DHCP server on it to assign IP addresses. This is normally the default on home networks. If your computer can connect to this network and work properly without a special configuration, then it's probably safe to assume the DHCP is working fine.
Hi
So I put in some quotation marks (") since I had a space in the network name, and the printout from the ifup/down has changed:
root@bela:~# ifup wlan0; ifdown wlan0;
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/wlan0/8c:3b:ad:2f:39:26
Sending on LPF/wlan0/8c:3b:ad:2f:39:26
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 16
DHCPREQUEST of 192.168.0.102 on wlan0 to 255.255.255.255 port 67
DHCPOFFER of 192.168.0.102 from 192.168.0.1
DHCPACK of 192.168.0.102 from 192.168.0.1
bound to 192.168.0.102 -- renewal in 25 seconds.
Killed old client process
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/wlan0/8c:3b:ad:2f:39:26
Sending on LPF/wlan0/8c:3b:ad:2f:39:26
Sending on Socket/fallback
DHCPRELEASE on wlan0 to 192.168.0.1 port 67
Still, i don't get any ip address when I do ip a. (I get: 3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether 8c:3b:ad:2f:39:26 brd ff:ff:ff:ff:ff:ff)
Does it mean that it is still not connected?
Hmmm that's weird:
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 16
DHCPREQUEST of 192.168.0.102 on wlan0 to 255.255.255.255 port 67
DHCPOFFER of 192.168.0.102 from 192.168.0.1
DHCPACK of 192.168.0.102 from 192.168.0.1
bound to 192.168.0.102 -- renewal in 25 seconds.
would indicate that you are actually successfully connected.
not sure about the
Killed old client process
...
DHCPRELEASE on wlan0 to 192.168.0.1 port 67
part ...
Did you retry ifup wlan0; ifup wlan0
?
Hi,
so I did only
root@bela:~# ifup wlan0;
and got
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/wlan0/8c:3b:ad:2f:39:26
Sending on LPF/wlan0/8c:3b:ad:2f:39:26
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
DHCPREQUEST of 192.168.0.102 on wlan0 to 255.255.255.255 port 67
DHCPOFFER of 192.168.0.102 from 192.168.0.1
DHCPREQUEST of 192.168.0.102 on wlan0 to 255.255.255.255 port 67
DHCPACK of 192.168.0.102 from 192.168.0.1
bound to 192.168.0.102 -- renewal in 31 seconds.
and now I finally got an IP when I do ip a. So, I guess it finally worked! Thanks for all the help
best,
Andreas