I was wondering if there are any examples of using XBEE bluetooth or other bluetooth shields with M2?
I am trying to compile some sample code, but they require SoftwareSerial library which doesn’t seem to be compatible with SAM architecture.
If your using the Macchina BT module it needs to be programmed. Once programmed you connect to it via the standard Serial interface. The XBee port I believe is Serial2 so you would talk to it the same as you would any other serial port. I have the ESP’s AT library installed on mine and I am able to talk to it via AT commands so I am not sure what your asking?
Please note that at this time the M2RET firmware does not take advantage of any port other than the USB port. At this time use of anything not supported directly my M2RET requires custom programming.
You need to contact the manufacturer for more information. If it does not line up with the Macchina’s UART pins then the Serial2 stuff won’t work with it and there likely is nothing currently written to talk to it. First step is to find out what communications methods are available for it.
@josh or @ecsharpe may be able to also share information about the Macchina module that has been created for use with the M2 that might be a better solution. This one has both BT and WiFi if you can not figure out your module. I notice it is not listed in the store yet but I have one here along with my beta module.
As far as I am aware (and I have not done much with mine yet) the only currently supported (in software) connection is via the UART serial connection.
If it does SPI then there are libraries for that but would need custom software to make it work.
I will be taking on a major project this summer to try and make the M2 firmware more modular but I don’t have access to this hardware module. When I am done, adding your module to the supported software would be a simple matter assuming you can sort out the method it uses.
Check out the link I showed above. Unless Macchina has started including firmware in the chip you need to install what you want onto that module. There are threads on here on how to get them up and running. I have a Beta one here running now and will be trying to get the production one running that I also have in a couple weeks when I am done with Finals.
I believe everything you should need is here:
But there may be another thread if you don’t get it done with that thread.
Basically you need to install a passthrough sketch on the M2, grab some software from ESP to install firmware on the module and once done you are off and running. They have AT commands for everything on the library I pointed to above. It takes a little work to get up and running but once done there are MANY things it can do.
Hopefully Macchina will start installing the AT library above by default on them. Once it is up and running it really is as simple as sending an AT to the module to get it to respond.
Please note that this module will be one of the first things I will be working with to insure my new software will not care how it is connected. There are Bluetooth serial drivers out there as well as Ethernet serial drivers out there so I will likely be using one of those to test the unit with the firmware. In theory you should be able to connect to the M2 via USB, BT, Ethernet or any other way and be able to access it the same way. By end of summer you should be able to use SavvyCAN connected to your M2 in a variety of ways.