XBee4Max – Sending data wirelessly in Max via XBee

I made this about a year ago and just never posted it. I’ve really gone off blogging but I figured this might be useful for other people who want to send and receive data wirelessly over XBee in Max. It uses RXTX to access the serial port from inside mxj so it requires you to copy a two files to Max’s support directory to get it to work. Most of the hard work is done by by Andrew Rapp’s excellent XBee java api so big shout outs to Andrew who was really helpful when I got stuck. I’ve had good results at baud rates up to 57,600 any faster and the Arduino seems to get it’s knickers in a twist reading the bytes out of the serial buffer. When loaded the external sends a node discover packet to ask the other XBees to chime back with there names, from then on you can send data using the ‘send’ message followed by the name of the XBee and the raw bytes your sending. It comes with a help file and the source is fairly transparent so feel free to hack away…

 

External: XBee4Max-Max-External.zip

Eclipse source code: XBee4Max-Eclipse-Source.zip

4 Responses to “XBee4Max – Sending data wirelessly in Max via XBee”

  1. Cappy2112

    Hi
    Thanks for the patch.
    It would be great if you could make the screenshot larger by clicking on it.
    It’s too small to read.

  2. jacob

    hi robin,

    i just tried using your promising xbee4max object. but after a while of getting connection errors, i realized i´ve got series1 modules.
    the help-file states its possible to fiddle the source code, but when i send “viewsource” message to the mxj the max-window gives me loads of error messages (see below). Any hints whats going on? And where to start?
    (I´m using max6, but had same issue in max5)
    thanks and best regards,
    jacob

    error messages in max window:
    locals:[0:NXBee4Max$Listener;,1:LXBee4Max;], stack:[]
    0_1576e70: aload 0
    locals:[0:NXBee4Max$Listener;,1:LXBee4Max;], stack:[NXBee4Max$Listener;]
    1_11381e7: aload 1
    locals:[0:NXBee4Max$Listener;,1:LXBee4Max;], stack:[NXBee4Max$Listener;,LXBee4Max;]
    2_1b5998f: putfield LXBee4Max$Listener; this$0 LXBee4Max;
    5_17494c8: aload 0
    6_d3db51: invokespecial Ljava/lang/Thread; ()V
    9_e3c624: return
    jode.jvm.VerifyException: 2_1b5998f: putfield LXBee4Max$Listener; this$0 LXBee4Max;
    at jode.jvm.CodeVerifier.modelEffect(CodeVerifier.java:877)
    at jode.jvm.CodeVerifier.doVerify(CodeVerifier.java:1033)
    at jode.jvm.CodeVerifier.verify(CodeVerifier.java:1102)
    at jode.decompiler.MethodAnalyzer.analyze(MethodAnalyzer.java:610)
    at jode.decompiler.ClassAnalyzer.analyze(ClassAnalyzer.java:315)
    at jode.decompiler.ClassAnalyzer.analyzeInnerClasses(ClassAnalyzer.java:388)
    at jode.decompiler.ClassAnalyzer.dumpJavaFile(ClassAnalyzer.java:626)
    at jode.decompiler.Decompiler.decompile(Decompiler.java:192)
    at com.cycling74.max.MXJDecompiler.decompile(MXJDecompiler.java:64)
    at com.cycling74.max.MaxObject._viewsourcejar(MaxObject.java:1057)
    at com.cycling74.max.MaxObject.viewsource(MaxObject.java:942)
    jode.AssertError: Verification error
    at jode.decompiler.MethodAnalyzer.analyze(MethodAnalyzer.java:613)
    at jode.decompiler.ClassAnalyzer.analyze(ClassAnalyzer.java:315)
    at jode.decompiler.ClassAnalyzer.analyzeInnerClasses(ClassAnalyzer.java:388)
    at jode.decompiler.ClassAnalyzer.dumpJavaFile(ClassAnalyzer.java:626)
    at jode.decompiler.Decompiler.decompile(Decompiler.java:192)
    at com.cycling74.max.MXJDecompiler.decompile(MXJDecompiler.java:64)
    at com.cycling74.max.MaxObject._viewsourcejar(MaxObject.java:1057)
    at com.cycling74.max.MaxObject.viewsource(MaxObject.java:942)

  3. crx

    Hi Jacob, I’d bung it into eclipse if I were you. The thing you need to do once you’ve opened it is check that the xbee api calls that I use to return the data to Max are all compatible with the Series 1 modems. Really I need to borrow a Series 1 XBee of someone so I can play test it.

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>