Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

controller.js error connecting #3

Open
ChronoGit opened this issue Dec 6, 2017 · 5 comments
Open

controller.js error connecting #3

ChronoGit opened this issue Dec 6, 2017 · 5 comments

Comments

@ChronoGit
Copy link

ChronoGit commented Dec 6, 2017

Hello!

I am having a problem with the controller program. Up until then, everything worked, and I could find the two IDs of my cars (Although they were a lot shorter than the ones in the screenshot).

If I now try to start the controller.js however, nothing happens on screen. The "help" command works, but every other command throws this error:

Command: s <Buffer 06 24 f4 01 d4 30 00>
Error sending command

My config file looks like this:

# Bluetooth config: mandatory

# BLE Peripheral/Car ID
# - GroundShock
carid=f0f42007e011
# - Skull
#carid=yourperipheralid


# Start lane: optional (1/right - 4/left, clockwise, default: 1)
# - GroundShock
startlane=4
# - Skull
#startlane=1


# MQTT config: optional
# Comment out the properties below if you don't want to connect to Bluemix

# Device ID you use when you register with the IoT foundation
# - GroundShock
#deviceid=da353e8ed420
# - Skull
#deviceid=yourdeviceid
# For controller (device)
# - GroundShock
authtoken=yourauthtoken
# - Skull
#authtoken=yourauthtoken

# Application key
apikey=yourapikey
apitoken=yourapitoken

Could it be a problem that I am running the program in a Linux VM?

Thanks for any help you can provide!

Sincerely,
Chrono

@kwiatks
Copy link

kwiatks commented Dec 6, 2017

Can you confirm you get connectivity to IBM Cloud/Bluemix MQTT ? you get a line saying connectivity has been made at the start of the App on the Mac. I have got the system working but have a real Mac where everything is running (i.e. bluetooth and connectivity to the Cloud).

Did the system ever work with your current setup ?

@ChronoGit
Copy link
Author

This was the first time I tried this application, so the System has not worked before.

I was also trying the Controller without Bluemix, as the instructions stated that as optional, as long as you comment the last lines out. Now in the version I posted that is not the case, however I also tried it with everything below the MQTT commented out.

@BenDuan
Copy link

BenDuan commented Jan 26, 2018

Hello,
I am having the same problem with the controller programm.
Have you solved this problem?

@pleribus
Copy link

After much hair pulling and logging to console, I was able to get this working by:

Using following to scan correctly with noble (replacing the startScanning section):

noble.on('stateChange', function(state) {
if (state === 'poweredOn') {
console.log('start scanning');
noble.startScanning();
} else {
noble.stopScanning();
}
});

and then also stepping through the services array until I found the matching characteristic.uuid's

peripheral.connect(function(error) {
peripheral.discoverServices([], function(error, services) {
var service = services[2];

(was 0, and only worked after setting to 2)

@honsa
Copy link

honsa commented Nov 17, 2018

Thanks for pulling your hair. This was the solution.

The problem are multiple Bluetooth devices so you have to select the correct from the service object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants