pibeacon selecting hci0 and not hci1

Posted on
Sun Jun 02, 2019 2:42 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: pibeacon selecting hci0 and not hci1

On any rpi you like set it to an active correct mac


Sent from my iPhone using Tapatalk

Posted on
Sun Jun 02, 2019 2:57 pm
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Re: pibeacon selecting hci0 and not hci1

So, by correct, you mean hci1, I take it? Just want to make sure I've got the correct input.

Posted on
Mon Jun 03, 2019 1:46 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: pibeacon selecting hci0 and not hci1

Whatever is active.

Could you try this:
https://scribles.net/changing-a-bluetoo ... pberry-pi/

Change the MAC address of hci0

Karl


Sent from my iPhone using Tapatalk

Posted on
Mon Jun 03, 2019 11:46 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: pibeacon selecting hci0 and not hci1

Just to clarify

The ble mac# is THE key for the rpi indigo devices to the raspberry server mapping . If they are all the same things can go really wrong.




Sent from my iPhone using Tapatalk

Posted on
Mon Jun 03, 2019 9:56 pm
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Re: pibeacon selecting hci0 and not hci1

Hey Karl,

Happy to try that if you'd like, but hci0 is unique across all of the pi's now, since i've pulled the usb on two of them. Do you want me to reinstall the dongle and then change a BLE MAC?

rpi0
Code: Select all
Devices:
   hci0   B8:27:EB:E1:4E:57


rpi1:
Code: Select all
Devices:
   hci0   B8:27:EB:A2:03:A9


pi2:
Code: Select all
Devices:
   hci1   B8:27:EB:55:B2:22
   hci0   00:1A:7D:DA:71:13


Let me know...

Posted on
Tue Jun 04, 2019 12:13 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

pibeacon selecting hci0 and not hci1

It looks as if the mac number of the rpi with 2 ble still has the same mac# for hci0

Could you take out the extra dongle and check what the new mac number of hci0 is?

Then if you have time try the tool to change the mac number and put the extra dongle in and check the mac numbers.

Just to understand


Once finally setup, enter the mac numbers into rpi device edit at the bottom. It SHOULD work then.




Sent from my iPhone using Tapatalk

Posted on
Fri Jun 07, 2019 11:40 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: pibeacon selecting hci0 and not hci1

put an extra BLE dongle into 2 RPI 3.

everything works as designed. Can switch Ibeacon MAC# and BLEmac # in device edit,

the RPI device changes its MAC number as designed , and no double (same) MAC # between the RPIs.

the only thing I can imagine is that the Wifi / ethernet conflicts messed up that one. -- or that the RPI OP-sys is different

I have a version ready that will add some more options to select wifi(wlan0) and ethernet (eth0)

use wlan0, use eth0, switch other on/off .. etc.

that should fix your setup.

could you try this one:
https://www.dropbox.com/s/a7s6bc3rd6lc7id/piBeacon.indigoPlugin.zip?dl=1

it offers the wifi/eth setup in config for all devices, and will be overwritten in device edit for each device individually

So open config once set the default (leave as proposed) , then edit the devices where you have double networks ie set wlan0 on, eth0 on, use wlan0
that will communicate the proper ip#(wlan0) to the pibeacon plugin and will keep eth0 running for your other programs.

Karl

Posted on
Sat Jun 08, 2019 7:46 pm
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Re: pibeacon selecting hci0 and not hci1

Ok, I'll try the new plugin.. Does that mean that you want me to use two USB BLE dongles on those RPI 2's? For now, I'll update the plugin and insure that the system is set to use the wlan0 ip address for all of the pis, and see how that goes. :-) .

thanx again. I think we're getting closer.
~ken

Posted on
Sat Jun 08, 2019 7:49 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: pibeacon selecting hci0 and not hci1

No need for 2 for rpi2
Only for rpi3


Sent from my iPhone using Tapatalk

Posted on
Sat Jun 08, 2019 9:30 pm
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Re: pibeacon selecting hci0 and not hci1

OK,

So I downloaded the new plugin, and oops.. all of my pi's config'd themselves to shutoff wifi by default. Wound up removing them all, as that seemed the cleanest way to get out of that. lol

Now, however, I'm getting socket errors and a TCPServerHandle error, which I"m guessing is related. Will re-add the devices after I get the plugin listening again.. Should I just use the std web server? I would think the socket connection would be preferable, yes?

Code: Select all
 piBeacon Error                  in Line '15595' has error='local variable 'TCPserverHandle' referenced before assignment'



Code: Select all
08 20:20:20 TCPIPsocket:: [Errno 49] Can't assign requested address     try#: 15   time elapsed: 33.3 secs
08 20:20:21 TCPIPsocket:: [Errno 49] Can't assign requested address     try#: 16   time elapsed: 34.4 secs
08 20:20:22 TCPIPsocket:: [Errno 49] Can't assign requested address     try#: 17   time elapsed: 35.4 secs
08 20:20:23 TCPIPsocket:: [Errno 49] Can't assign requested address     try#: 18   time elapsed: 36.4 secs
08 20:20:24 TCPIPsocket:: [Errno 49] Can't assign requested address     try#: 19   time elapsed: 37.4 secs
08 20:20:25 TCPIPsocket:: [Errno 49] Can't assign requested address     try#: 20   time elapsed: 38.4 secs
08 20:20:26 TCPIPsocket:: [Errno 49] Can't assign requested address     try#: 21   time elapsed: 39.5 secs
08 20:20:27 TCPIPsocket:: [Errno 49] Can't assign requested address     try#: 22   time elapsed: 40.5 secs
08 20:20:28 TCPIPsocket:: [Errno 49] Can't assign requested address     try#: 23   time elapsed: 41.5 secs
08 20:20:29 TCPIPsocket:: [Errno 49] Can't assign requested address     try#: 24   time elapsed: 42.5 secs
08 20:20:30 TCPIPsocket:: [Errno 49] Can't assign requested address     try#: 25   time elapsed: 43.5 secs


nothing is using that port on my mac though:
Code: Select all
ShrxCentral:~ shrxman$ sudo lsof -PiTCP -sTCP:LISTEN
Password:
COMMAND   PID    USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
launchd     1    root    9u  IPv6 0x25b0eb1d99bb0045      0t0  TCP *:5900 (LISTEN)
launchd     1    root   10u  IPv6 0x25b0eb1d99bafa85      0t0  TCP *:22 (LISTEN)
launchd     1    root   11u  IPv4 0x25b0eb1d99bb4545      0t0  TCP *:22 (LISTEN)
launchd     1    root   15u  IPv4 0x25b0eb1d99bb4ec5      0t0  TCP *:5900 (LISTEN)
launchd     1    root   16u  IPv6 0x25b0eb1d99bafa85      0t0  TCP *:22 (LISTEN)
launchd     1    root   17u  IPv4 0x25b0eb1d99bb4545      0t0  TCP *:22 (LISTEN)
UserEvent  39    root  103u  IPv6 0x25b0eb1d99bae945      0t0  TCP [fe80:9::aede:48ff:fe00:1122]:49153 (LISTEN)
UserEvent  39    root  104u  IPv6 0x25b0eb1d99bb0605      0t0  TCP [fe80:9::aede:48ff:fe00:1122]:49154 (LISTEN)
UserEvent  39    root  105u  IPv6 0x25b0eb1d99bae385      0t0  TCP [fe80:9::aede:48ff:fe00:1122]:49155 (LISTEN)
UserEvent  39    root  106u  IPv6 0x25b0eb1d99baddc5      0t0  TCP [fe80:9::aede:48ff:fe00:1122]:49156 (LISTEN)
kdc        85    root    5u  IPv6 0x25b0eb1d99baf4c5      0t0  TCP *:88 (LISTEN)
kdc        85    root    7u  IPv4 0x25b0eb1d99bb3bc5      0t0  TCP *:88 (LISTEN)
ARDAgent  306 shrxman    9u  IPv6 0x25b0eb1d9ea20a85      0t0  TCP *:3283 (LISTEN)
IndigoSer 385 shrxman    8u  IPv4 0x25b0eb1da2314bc5      0t0  TCP *:1176 (LISTEN)
Python    413 shrxman    3u  IPv4 0x25b0eb1da332b545      0t0  TCP *:8176 (LISTEN)
screensha 439    root  fp.u  IPv6 0x25b0eb1d99bb0045      0t0  TCP *:5900 (LISTEN) (fileport=0x2503)
screensha 439    root  fp.u  IPv4 0x25b0eb1d99bb4ec5      0t0  TCP *:5900 (LISTEN) (fileport=0x2603)
screensha 439    root    3u  IPv6 0x25b0eb1d99bb0045      0t0  TCP *:5900 (LISTEN)
screensha 439    root    4u  IPv4 0x25b0eb1d99bb4ec5      0t0  TCP *:5900 (LISTEN)
ShrxCentral:~ shrxman$ sudo netstat -ap tcp | grep -i "listen"
tcp4       0      0  *.8176                 *.*                    LISTEN
tcp4       0      0  *.indigo-server        *.*                    LISTEN
tcp46      0      0  *.net-assistant        *.*                    LISTEN
tcp6       0      0  fe80::aede:48ff:.49156 *.*                    LISTEN
tcp6       0      0  fe80::aede:48ff:.49155 *.*                    LISTEN
tcp6       0      0  fe80::aede:48ff:.49154 *.*                    LISTEN
tcp6       0      0  fe80::aede:48ff:.49153 *.*                    LISTEN
tcp4       0      0  *.kerberos             *.*                    LISTEN
tcp6       0      0  *.kerberos             *.*                    LISTEN
tcp4       0      0  *.rfb                  *.*                    LISTEN
tcp6       0      0  *.rfb                  *.*                    LISTEN
tcp4       0      0  *.ssh                  *.*                    LISTEN
tcp6       0      0  *.ssh                  *.*                    LISTEN

Posted on
Sat Jun 08, 2019 9:32 pm
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Re: pibeacon selecting hci0 and not hci1

hah. oops. False alarm on the socket errors. I spoke too soon. Had a typo in the IP address for the server, so there was no way for it to start correctly. My mistake. working on adding the ip's now.

Posted on
Sat Jun 08, 2019 11:14 pm
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Re: pibeacon selecting hci0 and not hci1

Ok, so now I do have a real issue. lol. Seems that, when I enable your python command in rc.local, my wifi gets shut off by master.py.

i hooked up a console, and see this on the display:
L:-1 switching wifi off


dug around a little in the code, specifically piBeaconUtils.py, and found that if i comment out the call to stopWifi() on line 917, all is well. So, it seems either the config didn't get pushed out, or there's still some logic wrong there somewhere. I commented that line out, restarted, and repushed the configs to that pi, thinking that maybe the wifi was shut off before the configs were pushed, but the problem persisted.

So now, with that line commented out, all seems to be back up and running. I'll continue to add my pi's and do some more testing tomorrow, to see where we are. I did notice, however, that the drop down list currently has all 0's for the BLE address, but I haven't enabled discovery of devices yet, so it may not have sent any updates. I'll enable that either later tonight, or tomorrow and see what we get for addresses once we get updates.

thanx again,
~ken

Posted on
Sun Jun 09, 2019 7:38 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: pibeacon selecting hci0 and not hci1

I guess here is the issue

By some config it set WiFi off
Then the plugin can not contact the rpi to set WiFi on as the ip number in the plugin for the rpi is the WiFi ip. So it stays in that mode - WiFi off

... I need to think about that one.

Karl


Sent from my iPhone using Tapatalk

Posted on
Sun Jun 09, 2019 9:18 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: pibeacon selecting hci0 and not hci1

I will put a fallback into the code:

if wlan0 off and can not connect to indigo, switch wifi on

same for eth0

but then I need to check for temporary situations where connection might be interrupted and don't want to change network config

.. interesting challenge.

Karl

Posted on
Sun Jun 09, 2019 11:40 am
shrxman offline
Posts: 83
Joined: Apr 22, 2015

Re: pibeacon selecting hci0 and not hci1

Hehehe. you know me.. Always giving you something to work on! lol . At least I was able to determine which line of code was breaking wifi, so that's something to work with.

Also, I seem to have the best luck so far setting it up so piBeacon chooses between the dongle and the internal device. When I set it that way, it seems the MAC's stay unique. At least so far. I had one pi that got deleted again, and I'm guessing it's because the BLE MAC's were the same. Deleted it in the app, because the device was gone even though it still showed up in your drop down lists, and just added it back. So far, the MAC is all 0's, but that typically takes a bit to populate, so I'll keep you posted there.

Just turned on beacon discovery, so I can add my beacons back and will see if things get back to normal. Only trick is, when you repush from the plugin, I think piBeaconUtils.py may get overwritten, so I may add to rc.local a cp command to put my version back in place for now. Easier to do that then go connect a monitor, keyboard, and mouse to my headless pis. lol

:-)

Who is online

Users browsing this forum: No registered users and 9 guests