master in Line '415' has error=''mac''

Posted on
Fri Mar 16, 2018 4:18 pm
Hackencrash offline
User avatar
Posts: 165
Joined: Dec 16, 2015
Location: UK

master in Line '415' has error=''mac''

There appears to be an error in master.py running on the rPi that manifests itself when selecting to run BLEconnect in parallel in Indigo on the rPi devices. Selecting to run in sequence clears the error.

Posted on
Fri Mar 16, 2018 6:05 pm
kw123 offline
User avatar
Posts: 5749
Joined: May 12, 2013
Location: Dallas, TX

Re: master in Line '415' has error=''mac''

Will check later today.




Sent from my iPhone using Tapatalk

Posted on
Fri Mar 16, 2018 8:42 pm
kw123 offline
User avatar
Posts: 5749
Joined: May 12, 2013
Location: Dallas, TX

Re: master in Line '415' has error=''mac''

v .. . 212 @ https://www.indigodomo.com/pluginstore/59/ should fix it .


Karl

Posted on
Sat Mar 17, 2018 11:14 am
Hackencrash offline
User avatar
Posts: 165
Joined: Dec 16, 2015
Location: UK

Re: master in Line '415' has error=''mac''

Thanks Karl,

Now I am getting:
Code: Select all
in line'929' has error='string index out of range'
beacon loop bad data,skipping
When I switch back to run in sequence, the error clears.

Posted on
Sat Mar 17, 2018 11:48 am
kw123 offline
User avatar
Posts: 5749
Joined: May 12, 2013
Location: Dallas, TX

Re: master in Line '415' has error=''mac''

thats in regular ibeacon sensor (beaconloop.py) it receives a junk message (too short) ... besides the error message nothing should happen

I should check for the length .. next release


Karl

Posted on
Sat Mar 17, 2018 1:11 pm
kw123 offline
User avatar
Posts: 5749
Joined: May 12, 2013
Location: Dallas, TX

Re: master in Line '415' has error=''mac''

Also what kind of setup do you have. Rpi 2/3 WiFi?

Try to add another BLE dongle. The BLEconnect will use the extra dongle so that it does not conflict with the regular iBeacon






Sent from my iPhone using Tapatalk

Posted on
Sun Mar 18, 2018 11:26 am
kw123 offline
User avatar
Posts: 5749
Joined: May 12, 2013
Location: Dallas, TX

Re: master in Line '415' has error=''mac''

in v ..213 it will check for more error conditions when receiving ibeacon packages on the RPI and will reject quietly non conforming messages.

Karl

ps also added for one wire temp sensors to show the serial number in the notes column.

Posted on
Tue Mar 20, 2018 6:57 am
Hackencrash offline
User avatar
Posts: 165
Joined: Dec 16, 2015
Location: UK

Re: master in Line '415' has error=''mac''

Ah, OK, I did the config.txt and modprobe thing to disable my rPi3’s onboard Bluetooth to use the adapter only. Are you implying that it may be better not to do this as piBeacon can use both onboard and USB Bluetooth adapters at once?


Sent from my iPhone using Tapatalk

Posted on
Tue Mar 20, 2018 9:19 am
kw123 offline
User avatar
Posts: 5749
Joined: May 12, 2013
Location: Dallas, TX

Re: master in Line '415' has error=''mac''

Issue with RPI3:wifi and BLE use the same hardware. There is a conflict when heavy BLE usage (sending=BLEconnect not listening=ibeacon) and wifi transmit is done at the same time.Then Wifi performance comes to a standstill.
==> solution: add another BLE dongle. pibeacon will use that one for BLEconnect

BLEconnect is trying to connect to the remote device (eg iPhone). During that time it OWNS the BLE stack. When 2 or more BLE connect programs are running this might create problems for regular ibeacon listening part.

So also here adding a second BLE dongle might help. Also I do not believe there is an advantage of having BLEconnect running in parallel for each target device. The timeouts are set to a few secs. That should not make any difference if a BLE device is home (retesting presence aver 60 secs), and when a single BLE device comes home it should get tested pretty quickly. Only issue I see when you have many BLE devices away and each of them is tried in sequence.

in summary: adding a second BLE dongle should improve the ibeacon side by separating BLEconnect from ibeacon

Karl

Posted on
Tue Mar 20, 2018 12:05 pm
Hackencrash offline
User avatar
Posts: 165
Joined: Dec 16, 2015
Location: UK

Re: master in Line '415' has error=''mac''

Ah, OK, so in my case I should re-enable the on-board Bluetooth on my pi3 so that beacons can use that whilst BLE devices will use my USB BLE dongle. I had no idea piBeacon would automatically do that 8)

Posted on
Tue Mar 20, 2018 12:46 pm
kw123 offline
User avatar
Posts: 5749
Joined: May 12, 2013
Location: Dallas, TX

Re: master in Line '415' has error=''mac''

that feature was sneaked in secretly 8) (*)


Karl

some 2 months ago

Code: Select all
def whichHCI():
    ret    = subprocess.Popen("hciconfig ",shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate()#################################  BLE iBeaconScanner  ----> end
    # try again, sometimes does not return anything
    if len(ret[0]) < 5:
        time.sleep(0.5)
        ret   = subprocess.Popen("hciconfig ",shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate()#################################  BLE iBeaconScanner  ----> end
        print "U.whichHCI, hciconfig 2. try: ",ret
       
    lines = ret[0].split("\n")
    hci={}
    for ll in range(len(lines)):
        if lines[ll].find("hci")>-1:
            bus = lines[ll].split("Bus: ")[1]
            hciNo = lines[ll].split(":")[0]
            hci[hciNo] = {"bus":bus, "numb":int(hciNo[3:])}
            if lines[ll+1].find("BD Address:")>-1:
                mm=lines[ll+1].strip().split(" ")
                if len(mm)>2:
                    hci[hciNo]["BLEmac"]=  mm[2]
        #hci1:   Type: Primary  Bus: UART
        #   BD Address: B8:27:EB:D4:E3:35  ACL MTU: 1021:8  SCO MTU: 64:1
        #   UP RUNNING
        #   RX bytes:2850 acl:21 sco:0 events:141 errors:0
        #   TX bytes:5581 acl:20 sco:0 commands:115 errors:0
        #
        #hci0:   Type: Primary  Bus: USB
        #   BD Address: 5C:F3:70:69:69:FB  ACL MTU: 1021:8  SCO MTU: 64:1
        #   UP RUNNING
        #   RX bytes:11143 acl:0 sco:0 events:379 errors:0
        #   TX bytes:4570 acl:0 sco:0 commands:125 errors:0
    if hci =={}: print lines
    return  hci               

Posted on
Tue Mar 20, 2018 4:53 pm
Hackencrash offline
User avatar
Posts: 165
Joined: Dec 16, 2015
Location: UK

Re: master in Line '415' has error=''mac''

Cool 8)

Just trying to decipher your Python...
If the hciconfig command reveals more than 2 Bluetooth adapters, e.g. onboard BT plus 2 USB BT adapters, what happens?

Posted on
Tue Mar 20, 2018 5:41 pm
kw123 offline
User avatar
Posts: 5749
Joined: May 12, 2013
Location: Dallas, TX

Re: master in Line '415' has error=''mac''

not an option, only 2 allowed don't know what will happen if you use more than 2

Posted on
Tue Mar 20, 2018 6:15 pm
Hackencrash offline
User avatar
Posts: 165
Joined: Dec 16, 2015
Location: UK

Re: master in Line '415' has error=''mac''

Good, that saves an Amazon order

Posted on
Tue Mar 20, 2018 8:00 pm
kw123 offline
User avatar
Posts: 5749
Joined: May 12, 2013
Location: Dallas, TX

Re: master in Line '415' has error=''mac''

And this only works on rpi3. Not rpi2. 2 BLE dongle would be both on usb bus

Will add that for rpi 2 when I am back.


Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron