Posted January 15, 201213 yr I've bought myself a NXT2 to help me improve my programming - I'm quite happy in MATLAB, but it is a lazy language. I'm trying not to use the packaged NXT software as my project(s) require additional elements such as vision. For now I'm trying to prove I've got the bluetooth connection to the brick and understand the sent/received data in MATLAB, and whilst I think I've acquired the port, printing to the brick seems to go into an infinite loop. Can anyone give me any pointers? I'm not sure if I've missed a handshake somewhere, but I'm simply trying to send 0x02 0x00 0x01 0x88 to have the brick return the firmware version. 0x02 0x00 should be the message length (so 2 bytes in little endian), and 0x01 0x88 is the command straight out of Appendix 1 (p11). It's quite likely I've made a stupid mistake Thanks in advance
January 17, 201213 yr I've bought myself a NXT2 to help me improve my programming - I'm quite happy in MATLAB, but it is a lazy language. I'm trying not to use the packaged NXT software as my project(s) require additional elements such as vision. For now I'm trying to prove I've got the bluetooth connection to the brick and understand the sent/received data in MATLAB, and whilst I think I've acquired the port, printing to the brick seems to go into an infinite loop. Can anyone give me any pointers? I'm not sure if I've missed a handshake somewhere, but I'm simply trying to send 0x02 0x00 0x01 0x88 to have the brick return the firmware version. 0x02 0x00 should be the message length (so 2 bytes in little endian), and 0x01 0x88 is the command straight out of Appendix 1 (p11). It's quite likely I've made a stupid mistake Thanks in advance Hey there, I done a bluetooth connection in Android based off NXT Remote. Does that help in anyway? I also used RobotC between 2 NXT's
January 17, 201213 yr Author Hey there, I done a bluetooth connection in Android based off NXT Remote. Does that help in anyway? I also used RobotC between 2 NXT's Didn't think anyone was going to reply for a minute there! It sounds like NXT remote basically gives you everything you need, so you're not having to deal with the horribleness of handshakes and hex. I think maybe I'll quickly learn C# and use the existing libraries for the time-being...but I'm purposefully being difficult to try to learn the low-level stuff. Any comments on Robot C? Did you use existing libraries or set up the comms yourself?
January 17, 201213 yr So NXT Remote is Android based and allows you to use direct commands. I changed this so I could send my own commands to RobotC RobotC to RobotC (NXT to NXT) via bluetooth in version 2 was pretty simple enough, I think they have changed it in 3 but I know someone who can help there. You can use microsoft robotics studio to control your NXT to, I believe. So it all depends on what you want to do. NXT to NXT (RobotC, NQC, Lejos etc) Phone to NXT (really has to be Android as IOS and WP7 have private Bluetooth stuff) PC to NXT (many things to chose from)
January 17, 201213 yr Author PC <-> NXT is what I want really, although Android-based tablets are looking increasingly appealing. I definitely will need some way of doing processing off-NXT, and will be using at least 1 webcam. I've got MS robotics studio installed, but am still working my way through C# tutorials at this stage
January 17, 201213 yr PC <-> NXT is what I want really, although Android-based tablets are looking increasingly appealing. I definitely will need some way of doing processing off-NXT, and will be using at least 1 webcam. I've got MS robotics studio installed, but am still working my way through C# tutorials at this stage Though I have the books and not read them, some of the Lejos books cover this. Sounds like your doing something I wanted to do. I do have plans to do a lot of web cam stuff
January 17, 201213 yr Author Though I have the books and not read them, some of the Lejos books cover this. Sounds like your doing something I wanted to do. I do have plans to do a lot of web cam stuff Java eh? Another language I know pitifully little about I'll read around Lejos, thanks.
January 17, 201213 yr Maybe we could try some stuff out as its an area I am interested in. c# should be easier to learn than Java. I am a developer anyway so that won't be a issue!
January 17, 201213 yr Author Maybe we could try some stuff out as its an area I am interested in. c# should be easier to learn than Java. I am a developer anyway so that won't be a issue! I've got about 5 years of MATLAB behind me, and mostly just writing scripts at that...hence trying to broaden my horizons, although choosing between the languages is tricky. I do a lot of image and signals processing at work, so am better on that end of things if you need help there.
January 20, 201213 yr I've got about 5 years of MATLAB behind me, and mostly just writing scripts at that...hence trying to broaden my horizons, although choosing between the languages is tricky. I do a lot of image and signals processing at work, so am better on that end of things if you need help there. There be quite a few samples out there that should help you mate.
January 21, 201213 yr Author There be quite a few samples out there that should help you mate. I've got something working now, albeit in C#
January 23, 201213 yr I've got something working now, albeit in C# Maybe you could post the useful samples that you find :)
January 23, 201213 yr Author Maybe you could post the useful samples that you find :) Burf, there's really not much to it - my struggling in MATLAB was probably just a quirk of the serial communication or me incorrectly formatting the data. I may revisit making it work in MATLAB...I want to do as much as possible myself though to maximise portability, so I won't be using other people's toolboxes. In C# the code is relatively simple, here for example - you simply connect over bluetooth, acquire the com port, then send and receive the communications in accordance with the manuals. The first two bytes give the packet length, so it's best to write a subroutine to sort those bytes, then the calls become simple, like for the message I mentioned in the OP: byte[] NxtMessage = {0x01, 0x88}; NXTSendCommandAndGetReply(NxtMessage);
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.