Show Posts
Pages: 1 2 3 [4] 5 6 ... 30
46  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: June 10, 2014, 02:51:27 am
I haven't decided yet on the best approach. The MQTT-SN protocol is also still a good solution for the wireless nodes, as it makes the gateway very easy: such a forwarding gateway is fully described - protocol and message encapsulation/decapsulation - in the MQTT-SN specification document.

Sensor nodes and gateway would both be based on AVR and Cosa.
I could use simple structs to compose messages and send them using one of the radio components available in Cosa.
For periodic sensor scans on the nodes, the Activity object seems very well suited.
Most sensors are already implemented in Cosa, so I get al lot for 'free' this way.

I think the overall architecture sounds just right. I would only tweak it a bit; 1) to allow low power wireless sensor nodes it is more efficient to push data instead of pull (scan), 2) there is a need for a plug-in wireless protocol so that it is really easy to administrate, 3) there is also a need for a management protocol for remote sensor configuration (and software update). These are some of the really interesting challenges in wireless sensor networks protocol design and implementation.

Implementing MQTT-SN on top of the Cosa Wireless interface seems like an interesting project and something I might consider.
Right now I am adding support for Low Power Lab Moteino with RFM69/H and playing around with ST7920 LCD.

47  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: June 09, 2014, 05:42:41 pm
I'm trying to figure out how to use LCD::SPI3W (or LCD::Serial3W) without connecting SCE to the Arduino. The reason is that I need the pins for other IO.
Can this be done in any simple way?

Yes, simply copy the IO adapter to your sketch and remove the SCE handling. This assumes that the LCD device does not require the SCE signal to latch data, etc, and it can be tied low.

48  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: June 09, 2014, 05:15:15 pm

Sounds like a nice project. Most of the components are available though there is still some glue missing.
Should I use Rete or Ciao for sending data from the wireless nodes to the central node?
Right now these two components do not contribute that much. Rete is more of a framework for wireless nodes inspired by Panstamp (, while Ciao is a compact, self-descriptive, data serialization method. If both the wireless nodes and central node are AVR based the simplest approach is to send binary data (e.g. struct) and do the MIB modeling on the central node. More complex and generalized solutions could use the Protocol Buffer or Ciao support together with encryption for transmission. And UML modeling to code generate the MIB map (e.g. Cosa Registry). It all depends on the scale of the project and the product standardization one wants to achieve.

could I use the Registry to translate the remote sensors to MQTT objects?
Yes, this is actually one of the use-cases for the Cosa Registry. For MQTT it would be more natural to use string names instead of index sequences (ala SNMP). This is one of those items on the to-do-list.

49  International / Scandinavia / Re: Synth(MIDI)-styrda ljuseffekter, påbörjat projekt, uppskattar feedback on: June 06, 2014, 05:53:40 am
Hum, kul projekt! Verkar enklare att bygga om tex eller 1M 30 Pixels WS2812B RGB band. Lite mer programmering men det är ju den roliga delen.

Skulle rekommendera att göra en tabelldriven lösning. Kanske till och med en interpretator för ett byte-orienterat språk. Då skulle man kunna skicka LED styrprogram över MIDI.

50  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: June 06, 2014, 05:09:10 am
Some news on the latest Cosa updates:

1. Bug fix
a. NRF24L01 auto acknowledgement
The Cosa NRF24L01 Wireless device driver had a problem with leaving auto acknowledgement pipe address enabled after send. This allowed illegal match of incoming message.
b. Removed compiler warnings
Compiler warnings on unused variables, empty while blocks and PROGMEM usage (older tool chain) have been removed.
c. bit_mask_write() name error

2. New Wireless example sketch: CosaWirelessRelay
Simple message relay example sketch. The example sketch should be used together with two additional nodes running CosaWirelessSender resp. CosaWirelessReceiver. The sender will send messages to node 1..3 and broadcast. The relay (node 3) will retransmit the message to node 1 (receiver).

3. Soft Shift Register Parallel Output template class (Soft::SRPO<N>, 74HC164)
A direct pin implementation of the SRPO<N> template class and new example sketch.

4. Soft Shift Register Parallel Input template class (Soft::SRPI<N>, 74HC165)
Input pin expander using 74HC165.
                      74HC165/1   (VCC)
                       +----U----+    |
 (D5/PLD)---+--------1-|/PL   VCC|-16-+
 (D4/SCL)-+-)--------2-|CP    /CE|-15-----------(GND)
 (Q4)-----)-)--------3-|D4     D3|-14------------(Q3)
 (Q5)-----)-)--------4-|D5     D2|-13------------(Q2)
 (Q6)-----)-)--------5-|D6     D1|-12------------(Q1)
 (Q7)-----)-)--------6-|D7     D0|-11------------(Q0)
          | |        7-|/Q7    DS|-10-----------------+
          | |      +-8-|GND    Q7|--9--------(SDA/D3) |
          | |      |   +---------+                    |
          | |      |      0.1uF                       |
          | |    (GND)-----||-------(VCC)             |
          | |                         |               |
          | |           74HC165/2     |               |
          | |          +----U----+    |               |
          | +--------1-|/PL   VCC|-16-+               |
          +----------2-|CP    /CE|-15-----------(GND) |
 (Q12)---------------3-|D4     D3|-14-----------(Q11) |
 (Q13)---------------4-|D5     D2|-13-----------(Q10) |
 (Q14)---------------5-|D6     D1|-12------------(Q9) |
 (Q15)---------------6-|D7     D0|-11------------(Q8) |
                     7-|/Q7    DS|-10                 |
                   +-8-|GND    Q7|--9-----------------+
                   |   +---------+
                   |      0.1uF

5. LCD adapter (SR3W/SR3WSPI/SR4W) with 74HC164
New circuit descriptions for LCD/HD44780 (aka 1602) adapters using 74HC164. Both cheap and fast (<$0.1 and <50 us per LCD operation). Uses only 3-4 pins.

6. New Blink example sketch
Blink RGB LED according to temperature reading from DS18B20; Short GREEN blink every 2 seconds if within 25-30 C. Blink BLUE if lower and RED if higher. Also demonstrates power down (<10 uA @ 3V3, ATtinyX4 @ 8 Mhz).

For more details see the github commit log;

51  Using Arduino / Displays / Re: Library Size on: June 01, 2014, 02:27:02 pm
Hum, I guess you did not read the info on the link. The answers are yes reduction by 10-20% or even more and yes there is a Mac OSX version. More details on the link. Cheers!
52  Using Arduino / Displays / Re: Library Size on: June 01, 2014, 01:04:21 pm
You could try the new AVR tool chain with GCC 4.8.1;!msg/developers/21G5w2HbUOg/bJtG94vEEhkJ

53  Development / Other Software Development / Re: Upload contributions in the Arduino libraries on: June 01, 2014, 09:34:03 am
Try posting your change here.!forum/developers
You should clone, do the change and issue a pull request. Follow that and I think you will get better attention. Your change is very small so that should not be a problem.  Cheers!
54  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: May 31, 2014, 06:03:20 pm
Check the CosaWirelessButton and the CosaWirelessReceiver example sketches. I think that will answer all your questions.

What might be confusing is that "outs.print(msg->payload, PAYLOAD_MAX);" prints the contents of the payload in hexadecimal notation. The payload does not contain the blanks. They are part of the formating.

Also the Wireless send/recv handle any data reference (void*) that is less or equal to the max payload size. The application can pass a string, struct, etc. Many of the example sketches pass struct's with binary data. The payload is not converted to and from strings (textual representation).

55  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: May 31, 2014, 05:46:22 pm
Two new Cosa example sketches that might be of interest:

1. TWI/10DOF
A new TWI example sketch demonstrates how to use a 10DOF module and display sensor readings on a LCD. The test setup is an Arduino Pro Micro with a GY-80 10DOF module, HD78440 (aka 1602) LCD with a GIICLCD TWI adapter running on a 1100 mAh 3.7V LiPo battery.

2. Ethernet/WebServer
The new Ethernet/Webserver example sketch demonstrates how to respond to HTTP GET requests by reading files from SD/FAT16 disks.

3. Pin Benchmark Statistics
Below is a link to the latest statistics for the Cosa Pin class benchmark (CosaBenchmarkPins.ino) for the old and new AVR toolchain.

4. Updated Ethernet/WebServer with Pin status.
More dynamic HTML generation for the CosaPinWebServer example sketch. Generates table with digital pin state and chart with analog pin reading (scaled 0..99).

56  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: May 31, 2014, 05:23:00 pm
I spent some time understanding the packet being sent, what I want to do is print out the NR value and a member of the payloads value on an lcd screen. I've managed to run the example code, and it outputs these values to the Uart trace fine. What I'm wondering is how to take some of these values and concert them to integers so I can either store them or print them to the lcd screen. I'm using the payload type of message and am having trouble getting the NR member's value into an integer.

Thanks a lot for this project there is a lot of interesting stuff in here. Sorry I'm pretty green when it comes to coding.
You are welcome!

There are a number of examples of how to use the Cosa LCD. If you can print to the UART you can do the same with the LCD. They are both IOStream::Device's and you can simply bind trace to the LCD.

The rest of your questions are difficult to understand without some code. You must understand the basic data types in C/C++ and how to convert between textual and binary representations. Most of the necessary conversions are done by the IOStream class.

57  International / Scandinavia / Re: Hur får jag en billig RF 433 MHZ modul att sända när jag aktiverar en knapp? on: May 31, 2014, 09:50:31 am
Kanske mer än du behöver? Nedan "skiss" använder näst intill ingen ström i väntan på att man trycker på en knapp. Vid knapptryckning läser den två analoga värden och skickar som meddelande tillsammans med tidsmärke och batteristatus. Kan konfigureras för att använda CC1101, NRF24L01P, RF433 eller RFM69. Kan köras på de flesta Arduino men också ATtiny. Skrivet i Cosa.

58  Development / Other Hardware Development / Re: Multi ATtiny programmer on: May 30, 2014, 02:46:09 pm
I use a simpler solution; a 40 pin ZIF socket, upper end for AttinyX5 and lower end for AttinyX4. See
NB. The blog shows the early design with only AttinyX5. Since then I have added support for AttinyX4.

59  Using Arduino / Installation & Troubleshooting / Re: Help with Cosa Installation on: May 28, 2014, 02:30:09 am
Cosa should be really simple to install and get running. Sorry to hear that you are having problems with that. Could you please provide some more information?

1. What version of the Arduino IDE are you using?
The support for 1.0.X was deprecated a few weeks back as the development focused on 1.5.X and the new AVR toolchain BUT as there has been a number of requests for keeping the 1.0.X support it now available again (See If you are using 1.0.X please download Cosa from github and install again.

2. What Arduino board are you using?
You MUST select a Cosa prefixed board in the IDE Tools>Board menu. This is how the Cosa core is selected. The Cosa example sketches do not compile with the Arduino core.

Please note that Cosa is not an Arduino(TM) product. Support requests should be posted on the Cosa github issue list. This will give you the best and quickest response.

60  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: May 27, 2014, 04:37:52 am
Some news on the latest Cosa updates:

1. Restored support for Arduino IDE 1.0.X
The Arduino 1.0.X IDE support was deprecated but has been restored after some requests.

2. Ethernet Shield example sketch robustness
The SD and W5100 device on the Ethernet Shield may interfere each other if not correctly disabled. The Ethernet example sketches have been updated to avoid the interference and improve robustness.

3.  More program memory free space on Leonard/Micro/Lilypad-USB (ATmega32U4)
The USB/CDC functionality is only added when needed. This allows larger sketches on ATmega32U4 devices. Compiling an empty sketch with Arduino/Wiring (1.5.6) gives:
Sketch uses 3,976 bytes (13%) of program storage space. Maximum is 28,672 bytes.
Global variables use 158 bytes (6%) of dynamic memory, leaving 2,402 bytes for local variables. Maximum is 2,560 bytes.
The latest Cosa update gives:
Sketch uses 290 bytes (1%) of program storage space. Maximum is 28,672 bytes.
Global variables use 0 bytes (0%) of dynamic memory, leaving 2,560 bytes for local variables. Maximum is 2,560 bytes.

4. LCD IO Adapter abstraction for PCD8544 and ST7565
The HD78440 LCD (1602/2004) IO Adapter abstraction is now implemented for the PCD8544 and ST7565. The two adapters are 1) serial output pin (Serial3W) and 2) SPI output (SPI3W).
Interface (LCD::IO):

5. Pin Benchmarks
The Cosa Pin classes have been further optimized and there are a set of new benchmark run files.
a. Arduino 1.0.5/1.5.6-r2 toolchain
b. Arduino Nightly build with new AVR toolchain (GCC 4.8.1)
c. Arduino Nightly build with new AVR toolchain (GCC 4.8.1) with link-time-optimization

6. Improved HTTP::Server response io-stream handling
The support for writing simple HTTP servers has been improved with IOStream binding and parsing path, query and request type.

7. Completed support for Teensy 2.0/Teensy++ 2.0

Pages: 1 2 3 [4] 5 6 ... 30