nymea / berrylan

Raspberry Pi WiFi setup
http://berrylan.org
GNU General Public License v3.0
338 stars 56 forks source link

mode = always not working #88

Open caspersauce opened 1 week ago

caspersauce commented 1 week ago

I used the image from this website about 2 weeks ago, and was able to successfully use the iPhone BerryLan app to connect to bluetooth on a Raspberry Pi W 2. I then brought the raspberry pi home a while later and noticed the bluetooth doesn't broadcast. Found a post on here that changing mode to always will make it broadcast again.

This is my conf file:

[General] Mode=always Timeout=60 AdvertiseName=nymea-nm ForceFullName=false PlatformName=nymea-pi ButtonGpio=-1 ButtonActiveLow=false DBusBusType=system

It never broadcasts. It hasn't since the original configuration.

How do I get it to broadcast again so I can configure the device at a different site?

caspersauce commented 3 days ago

Is this repository no longer maintained? Maybe that is why it doesn't work properly?

t-mon commented 3 days ago

This app is actually no longer maintained, the related nymea-networkmanager doing the work on the pi side is. Either way, the app should still continue to work, since this issue does not seem to be related with the app.

Can you provide the logs of your nymea-networkmanager running on the pi, that should give a hint why it is not working

journalctl -f -u nymea-networkmanager

What does hciconfig -a give you?

Which image did you use?

caspersauce commented 2 days ago

that journalctl command just hangs indefinitely... is it correct?

I just did a fresh install and I removed the "-f" argument and took the last lines from the output:

Nov 22 23:28:20 nymea systemd[1]: Stopping nymea-networkmanager.service - Daemon for nymea to configure wifi network using a Bluetooth LE connection...
Nov 22 23:28:21 nymea systemd[1]: nymea-networkmanager.service: Deactivated successfully.
Nov 22 23:28:21 nymea systemd[1]: Stopped nymea-networkmanager.service - Daemon for nymea to configure wifi network using a Bluetooth LE connection.

This is the last time it ever reports. Even If I restart the pi it never comes back. I assume that is why the the always argument isn't doing anything.

hciconfig -a gives this output:

hci0:   Type: Primary  Bus: UART
        BD Address: B8:27:EB:DE:8E:E3  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING 
        RX bytes:3433 acl:0 sco:0 events:289 errors:0
        TX bytes:50197 acl:0 sco:0 commands:289 errors:0
        Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
        Link policy: RSWITCH SNIFF 
        Link mode: PERIPHERAL ACCEPT 
        Name: 'nymea'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous, 
        HCI Version: 4.2 (0x8)  Revision: 0x412
        LMP Version: 4.2 (0x8)  Subversion: 0x2209
        Manufacturer: Broadcom Corporation (15)

I used the October 29th image link from this repository readme

caspersauce commented 2 days ago

After reading the journalctl I decided to do the obvious and start the service again. This works to enable the bluetooth connection again.

The commands do not persist through reboot. How do I get the service to always be enabled?

sudo systemctl enable nymea-networkmanager
sudo systemctl start nymea-networkmanager
t-mon commented 1 hour ago

maybe systemctl status nymea-networkmanager gives you a hint why it is not starting automatically.

The last 2 commands you posted should actually do the job.