Jump to content

Trouble with WAIT_FOR_PRESENT and WAIT_FOR_NOTPRESENT


cader
 Share

Go to solution Solved by Darren Kitchen,

Recommended Posts

So far I have not been able to have success with either of these.

Are they BT low energy only? Does the function expect the BT mac address or the device name? 

I've tried with many combinations of various options and even looked over a hex dump of the output of /dev/ttyS1

Has anyone else been able to make this work? What am I missing?

Link to comment
Share on other sites

Posted (edited)
#!/bin/bash
function WHY_NO_WORK() {
    stty -F /dev/ttyS1 speed 115200 cs8 -cstopb -parenb -echo -ixon -icanon -opost
    stty -F /dev/ttyS1 speed 115200 cs8 -cstopb -parenb -echo -ixon -icanon -opost
    sleep 1
    echo -n -e "AT+ROLE=2" > /dev/ttyS1
    echo -n -e "AT+RESET" > /dev/ttyS1
    while true; do
        timeout 1s cat /dev/ttyS1 > /tmp/bt_observation
        if grep -qao $1 /tmp/bt_observation; then
            echo "$1 found"
        else
            echo "$1 not found"
        fi
    done
}

WHY_NO_WORK 58:A8:F8:A6:C6:69

Is how I've been testing the BT chip after trying the above. 

Edited by cader
Link to comment
Share on other sites

The only device I've been able to detect with both the above script and the included functions has been my neighbors fitbit. My keyboard and phone (both in normal operation, pairing mode, and my phone running multiple kinds of beacon apps) are not detected. 

So I cracked the device open and discovered the BBmk2 uses an E104-BT52 chip for RX. I don't know enough about bluetooth to speak with authority, but the chip seems to be focused on BLE. I don't know why a normal BT radio was off the table as the device only runs when supplied with USB power and doesn't have the restricted power parameters of normal BLE applications. 

 

Maybe it's a firmware or tooling issue. IDK. But I can say for certain that the radio capabilities of the device are early alpha at best. I hope to be proven wrong as this was not a cheap device.

Link to comment
Share on other sites

THANK YOU!! I'd given up for a bit with the trigger. So I appreciate the write up. I apologize for my sass. I was getting a little frustrated after fruitless debugging of a black box system and I was rude. 

 

My bad.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...