Blue tooth communication
Page 1 of 1

Author:  JELPHS [ Tue Jan 07, 2014 1:35 pm ]
Post subject:  Blue tooth communication

Is it possible to communicate between two NXT bricks using an NXT cable to send and receive information? Does anyone have a sample of this? it looks like the xBee will be a great long term solution, but I need to get something hacked to together that I can later convert over to a wireless xBee communication methodology. Any pointers would be appreciated.

Author:  JohnWatson [ Thu Jan 09, 2014 12:16 pm ]
Post subject:  Re: Blue tooth communication

Have you considered using the built-in bluetooth adapters to connect the two NXT bricks together wireless? We have a full setup guide on our wiki ( ... NXT_Bricks) that can help walk you through the process, as well as a listing of ROBOTC Bluetooth functions to get you started with the programming (

Author:  Ford Prefect [ Thu Jan 09, 2014 1:12 pm ]
Post subject:  Re: Blue tooth communication

it would be really great if you could provide us with a sample program for a quick-as-possible-polling of all the slave's sensors (perpetually or on demand, including slave encoder readings) and commanding all the slave's motors (intermediately, on demand) by the master NXT... (via rs485 or via BT)

It should make all slave I/Os accessable just as if they were local on the master, sort of mimic "daisy chaining" which is currently provided by the EV3 Lego software for up to 4 EV3s


Author:  Ford Prefect [ Wed Jan 15, 2014 8:32 am ]
Post subject:  Re: Blue tooth communication

... Earth Control to Robomatter ...?

Author:  tfriez [ Wed Jan 15, 2014 4:57 pm ]
Post subject:  Re: Blue tooth communication

Robomatter here... It's a little fuzzy as of late... maybe slowly moving to new web servers will help.

ROBOTC supports the RS-485 method of communicating. This is what we use for our XBee Projects ( That method uses two wireless Xbee Radio's using Dexter Industries's "NXTBee Adapter" (cool sidebar: John at Dexter Industries actually designed the NXTBee for us originally for a project we were doing!)

One of the cool thing you can do though is replace your Xbee radios and just throw a normal NXT sensor cable between Sensor Port 4 on a pair of NXTs and do the same serial communication between those. Using that and your own custom serial protocol, you can easily make a program that will read/control sensors and motors on another brick. We have some examples on how to get started and an easy to use Xbee/RS485 library included with ROBOTC (just add #include "XbeeTools.h" to your program) to access the commands covered in the "firewiki".

It's no fun if we give you guys all of the code needed for your projects - plus we have other important things to do... like finish working on EV3 :)

Author:  Ford Prefect [ Wed Jan 15, 2014 5:43 pm ]
Post subject:  Re: Blue tooth communication

thank you, but I don't have xbees.
I just wanted to do it just via rs485 (S4-S4) or preferably via BT as one won't waste another precious NXT sensor port - or both all at once, connecting 1 master to 1 BT slave and to 1 other rs485 slave.

I actually thought that after 7 years of NXT life there should be easy and powerful communication APIs providing message control protocols like. e.g.,
    RemoteSetSensor(char conntype, long netID, char port, char SensorPortType); // SensorPortType: ADC_TYPE or I2C_TYPE
    RemoteGetSensor(char conntype, long netID, char port, long SensorType, long * values[] );   // pointer to the sensor value / array
    RemoteGetEncoderCounter(char conntype, long netID, char port, long * value );
// usage:
    RemoteSetSensor(rs485, 1, S1, ADC_TYPE );  // via rs485: config at slave #1: ADC sensor at S1
    RemoteSetSensor(rs485, 1, S2, I2C_TYPE );  // via rs485: config at slave #1: I2C sensor at S2
    RemoteGetSensor(rs485, 1, S1, SENSOR_LEGO_TOUCH, touch_reading);      // via rs485: read at slave #1: Touch Sensor value at S1
    RemoteGetSensor(rs485, 1, S2, SENSOR_LEGO_USNXT, USS_reading);        // via rs485: read at slave #1: US Sensor value at S2

    RemoteGetEncoderCounter(rs485, 1, motor_C, counter);    // via rs485: at slave #1: read motor rotation counter of motor_C (e.g., OUT_BC optional)

An underlying (already implemented and integrated) RobotC network protocoll should make it MT-safe and should protect from data collision, data loss, and data corruption.
It could be something like the bitbus protocoll which is implemented by Java/LeJos, but this of course requires RobotC firmware changes.

for using BT instead of rs485, just the data transmission mode and the slaveID will have to be exchanged in the function call:
    RemoteGetSensor(BT, 2, S1, SENSOR_LEGO_TOUCH, touch_reading);      // via BT: read at slave #2: Touch Sensor value at S1

analoguously there should be advanced remote motor command already available by the firmware, e.g.

    RemoteOnMotor(BT, 2, port , pwr);  // via BT:  at slave #2: motor ON at port (A,B,C,D) with pwr(-100...0...+100)
    RemoteBrake(BT, 2, port );  // via BT:  at slave #2: motor off and brake at port (A,B,C,D)
    RemoteCoast(BT, 2, port );  // via BT:  at slave #2: motor off and coast at port (A,B,C,D)

    RemoteRotateMotorDegrees(BT, slaveID, port, degrees, pwr)  // via BT:  at slave #2: motor ON at port (A,B,C,D) for (degrees) with pwr(-100...0...+100)
// e.g.,
    RemoteRotateMotorDegrees(BT, 2, motor_A, 3600,   80)   // via BT:  at slave #2: motor ON at motor(A) for 3600 degrees with pwr=80

I was looking for code using NXT-networking like this and expected to be published and available meanwhile.

BTW, for the EV3 via USB the user API could look quite similar!
RemoteGetSensor(USB, 3, S1, SENSOR_LEGO_TOUCH, touch_reading);      // via USB: read at slave #3: Touch Sensor value at S1

But first of all the BT and rs485 comm protocol APIs would be needed for my last 3 NXTs I've got!

Author:  rogerhenry [ Wed Feb 05, 2014 7:46 am ]
Post subject:  Re: Blue tooth communication

I don,t know about this but thanks for the post

play free online pokies

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group