Hi @Boken-Lin I can find a tutorial that explains how to read pin A0 through i2c with Arduino Dock and Python?
You could send me the python and ide code to do it?
Thank you
FB
The easiest way to do that would be to use this product from Adafruit
https://www.adafruit.com/products/2267
Some Arduino code that you could convert :
https://github.com/adafruit/Adafruit_BluefruitLE_nRF51/tree/master/examples/beacon
https://github.com/adafruit/Adafruit_BluefruitLE_nRF51/tree/master/examples/eddystone
Take a look at this too:
https://learn.adafruit.com/google-physical-web-uribeacon-with-the-bluefruit-le-friend/getting-started
https://learn.adafruit.com/introducing-adafruit-ble-bluetooth-low-energy-friend/beacon
You could also try this tutorial, it is for Raspberry Pi but most concepts apply to the Omega
https://learn.adafruit.com/pibeacon-ibeacon-with-a-raspberry-pi/what-is-ibeacon
@mark-doutre Thanks - found that. Though I think it would still be good if there was a more direct method of stopping it.
Regarding the running of the broker on the Omega, I agree with your comment. So far I have just been playing with MQTT and having a local broker under one's own control is a valuable part of getting to understand it all. In the real world, using a separate broker somewhere else is probably the way to go.
Any way, thanks for your interest and comments
@Johan-Simons I previously used a similar I2C I/O expander with my Arduino - it worked well.
In case you are interested, the expander break out I used was http://www.gravitech.us/i2c16gpex.html which uses a PCA9535 chip which provides similar capability to the MCP23008 but with 16 I/O pins rather than 8. Also, the documentation on PCA9535 says:
No glitch on power-up
Internal power-on reset
It worked well for me.
@Kit-Bishop Again, thanks for pointing me into some direction
I decided to connect only the needed pins for the OLED expansion instead of stacking it on the expansion board.
For all others - schematic is here: https://community.onion.io/topic/260/pinouts-for-omega-docks-and-expansions/2
Cheers ben
@mark-doutre Alternatively, you could see if you could find a Bluetooth board that had I2C interface - I couldn't find one (though possibly BLE112 might be worth looking at - see: https://www.bluegiga.com/en-US/products/ble112-bluetooth-smart-module/), I really only found Bluetooth boards with either UART or SPI.
You could possibly use an I2C to UART bridge or an I2C to SPI bridge - these seem to be relatively available.
@Frederic-Baumann Yes, agreed. Sorry I missed your earlier reference to line 202 in zonenamePromise - that is exactly what I had found too. Though changing the code to what I think it should be still doesn't work properly for me. I will dig further and let you know how it goes.
@Matt-Ogborne I can provide some pointers to C access to the GPIO pins.
Or rather in C++ (not significantly more complex than using C)
There is some official code (fast-gpio) in https://github.com/OnionIoT/fast-gpio specifically https://github.com/OnionIoT/fast-gpio/blob/master/src/fastgpio.cpp
Additionally, I have produced and published some C++ code for GPIO access that significantly expands on the functionality that is provided by fast-gpio including the capability of handling interrupts. This code (new-gpio), including documentation can be found at https://github.com/KitBishop/new-gpio
This code is currently being improved further and updates will be published as they become available.
As an aside, there is also associated Java wrapper code for this that can be found at https://github.com/KitBishop/java-gpio in case you are interested.
@Matt-Ogborne Unfortunately, not really. There has been some discussion on this and the Omega people have suggested they might some time in the future produce an A/D expansion but i wouldn't hold my breath on this - see https://community.onion.io/topic/390/is-there-any-way-to-read-analogue-input-with-the-omega for the original discussion.
One current option is to use the Arduino Expansion but this adds a whole level of additional complexity.
If accuracy and speed is not of concern to you, one way of doing it involves timing how long it takes to charge a capacitor. There is information on the general principle for doing this at http://www.raspberrypi-spy.co.uk/2012/08/reading-analogue-sensors-with-one-gpio-pin/ - this is for the Raspberry PI but I'm pretty sure the technique could be adapted for the Omega.
@None-None it is definitely possible, after all the Relay Expansion is controlled through I2C.
If you want to work it out for yourself, you can take a look at the i2c-exp-driver repo on GitHub. Start with https://github.com/OnionIoT/i2c-exp-driver/blob/master/src/relay-exp.c
You'll see that it uses functions from:
https://github.com/OnionIoT/i2c-exp-driver/blob/master/src/lib/onion-mcp23008-driver.c
You'll be able to see the register responsible for controlling the state of the relays.
If you don't wanna work it out for yourself... lemme know and I'll tell you
Hi @Boken-Lin ... Sorry for the long delay in replying... I finally got it to work.. all I had to do was replace "wpad-mini" with "wpad" using the steps described by @faulty-lee in this post