Show Posts
Pages: 1 ... 6 7 [8] 9 10 ... 29
106  Development / Other Software Development / Re: "optimizing compiler" on: March 05, 2014, 03:28:08 am
Replacing "avr-size" with "as" is not correct. Try removing that all together. Skip the size information for now and generate the symbol and listing file first. Then you have something to work on.

To implement the "avr-size" information I think it's easiest just to look at what the IDE for 1.5.X does as it produces that information at the end of the build.

Cheers!
107  Development / Other Software Development / Re: "optimizing compiler" on: March 04, 2014, 06:21:35 pm
Ok. I do not use a mac so this is hand-waving.

First you have to find the Arduino installation and locate the AVR tools bin directory. Add that to your PATH or simply execute the script from there. On my machine it is /opt/arduino-1.5.6-r2/hardware/tools/avr/bin.

Second check where the Arduino build puts the compiled files and replace the /tmp/build*/ etc with that path. Hint: Enable compiler printout in the Arduino IDE and look for the path when compiling.

When you get this working I will be waiting for the next question ;-)

Cheers!
108  Development / Other Software Development / Re: "optimizing compiler" on: March 04, 2014, 04:04:55 pm
So is there some way to understand what is going on? Yes, there are tools to this. Not in the Arduino library but in the AVR toolbox. You can check what goes into the build and understand the difference and thus find the source to the problem. Below is a Linux shell script that I use to generate a list and symbol file (to reduce the Cosa footprint, do not what to end up with this type of problems ;-)
Code:
avr-size -C /tmp/build*.tmp/$1.cpp.elf > $1.lst
avr-objdump -d /tmp/build*.tmp/$1.cpp.elf >> $1.lst
avr-nm -CS /tmp/build*.tmp/$1.cpp.elf > $1.sym
The script generates size information and an assembly listing but also a symbol file.

"Know your numbers",

Cheers!
109  Development / Other Hardware Development / Re: Memory space on: March 04, 2014, 03:44:18 pm
Here is the information you are looking for or at least a pointer in the right direction; http://en.wikipedia.org/wiki/List_of_Arduino_boards_and_compatible_systems

Cheers!

PS: Don't forget to donate to Wikepedia. Support open information. DS.
110  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: March 03, 2014, 06:33:08 pm
The latest update of Cosa includes a ThingSpeak client for channel update. Allows post of sensor data to the ThingSpeak server and then visualization. The example sketch demonstrates reading a DHT11 sensor and posting humidity and temperature reading. https://thingspeak.com/channels/10734. Below is a snippet from the example sketch.
Code:
void loop()
{
  ThingSpeak::Channel channel(&client, KEY);
  ThingSpeak::Entry update;
  sensor.sample();
  update.set_field(1, sensor.get_temperature(), 1);
  update.set_field(2, sensor.get_humidity(), 1);
  TRACE(channel.post(update)));
  SLEEP(20);
}
Example: https://github.com/mikaelpatel/Cosa/blob/master/examples/IoT/ThingSpeak/CosaThingSpeakClient/CosaThingSpeakClient.ino
Interface: https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/IoT/ThingSpeak.hh

This interface is not complete and currently only supports channel update. It will be extended with support for the other ThingSpeak server features; e.g. TalkBack, ThingHTTP, TweetControl API, and chart download to Arduino TFT (Cosa Canvas).

Cheers!

111  Development / Other Software Development / Re: Cosa: An Object-Oriented Platform for Arduino programming on: March 02, 2014, 10:28:59 am
I already like  where Nucleo is going. Looks very promising for the more complex tasks where a simple Arduino performs several parallel tasks!
@MarsWarrior
The above post was the initial increments of Nucleo, the multi-tasking support in Cosa.  It will be integrated with the Cosa watchdog, timers and drivers in coming updates. There will also be more support for message passing, thread synchronization and priority. Also I need to work though the ISR integration so that it at least becomes possible to signal a thread from an ISR. Nucleo is right now a very simple straight forward implementation and very much in the prototyping phase.

I also checked the examples for MQTT. I see that you are using the LAN interface. Is it possible for remote nodes to send MQTT rmessages over an RF connection (nRF24, RFM69), to a central node that puts the message on the LAN?
It is unclear to me that the RFconnection can send large messages.
Yes, the Cosa MQTT client implementation uses Sockets and the Cosa W5100 device driver. There is no support for MQTT over the Wireless interfaces (MQTT-SN?). Right now the Wireless device drivers do not handle large payloads or streams. The interface is not connection oriented as TCP/IP. It is possible to bridge the Wireless interface to MQTT. Basically a central node that receives wireless messages with sensor data and then translates and transmitts them to a MQTT server.

The Wireless interface will later on support message acknowledgement and retransmission (as the NRF24L01+ has builtin). And after that extended to allow routing nodes. Then on top of that it is better suited to implement MQTT-SN.

Anyway this is all about the architecture and infra-structure for small sensor networks. And what I want to point out is that the local sensor network may use very cheap RF technology and transmit to a bridge instead of forcing a heavy weight TCP/IP socket level protocol onto the sensor nodes.

I am considering adding support for Exosite, Xively, ThingSpeak and XMPP. The two first are commerical protocols so I need to work out the details if promoting them and their server/cloud services. The challenge will be to abstract them (including MQTT and SNMP) to a single interface so that applications may move between them.

I recently got hold of a SIM900 GSM / GPRS Shield development board and plan to write a Socket driver for that. All the Cosa Ethernet (INET) classes such as MQTT can then be used with this transport layer.

Cheers!
112  Using Arduino / Programming Questions / Re: Can use 2 sensor(BMP085 and BMP180) on i2c Arduino ? on: February 27, 2014, 05:32:25 pm
The two devices have the same I2C address and therefore cannot be on the same bus. It is possible to use two busses; one hardware I2C and one software I2C. Search for Soft TWI on the forum.

Cheers!
113  Using Arduino / Programming Questions / Re: Structure and function with pointer for PID on: February 27, 2014, 04:59:25 pm
Just two small changes and you will get the syntax right:

Code:
  struct SPid_t {
  double dState; // Last position input
  double iState; // Integrator state
  double iMax;
  double iMin; // Maximum and minimum allowable integrator state
  double iGain; // integral gain
  double pGain; // proportional gain
  double dGain; // derivative gain
};
...
double UpdatePID(SPid_t *pid, double error, double position)
...

Cheers!
114  Using Arduino / Programming Questions / Re: A working sketch for DS1302 real time module? on: February 27, 2014, 04:54:03 pm
Here is an example sketch. https://github.com/mikaelpatel/Cosa/blob/master/examples/Drivers/CosaDS1302/CosaDS1302.ino
It uses the Cosa DS1302 device driver and time class. It also demonstrates how to use the RAM on the device.
Interface: https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Driver/DS1302.hh
Documentation: http://dl.dropboxusercontent.com/u/993383/Cosa/doc/html/de/d0d/classDS1302.html

Cheers!
115  Topics / Product Design / Re: Converting binary strings to bytes/integers? on: February 26, 2014, 05:36:42 pm
I would like to recommend checking the AVR C-Lib when in need. There a tons of standard C functions ready to be used. The above problem can be solved with a single function call.
Code:
int value = strtol(data, (char**) NULL, 2);
http://www.nongnu.org/avr-libc/user-manual/group__avr__stdlib.html#gaf8ce3b8dae3d45c34c3b172de503f7b3
Arduino is NOT a programming language. It is a set of function implemented in C and partly C++.

Also I would recommend avoiding the Arduino String class as this often leads to "the dark side". The standard C string functions are more efficient and does not hide memory issues.

Cheers!
116  Using Arduino / Networking, Protocols, and Devices / Re: SNMP Manager example code on: February 26, 2014, 03:33:21 am
The post title is "Manager". Missed that. The above implementations are Agents and not Managers. This would mean that you wish to construct SNMP requests, send them and receive responses and parse them.

The code in at least the Cosa library could be refactored to do that. I will consider that for the next update. This is a new usecase.

Cheers!
117  Development / Other Software Development / Re: PSTR() flash string de-duplication -- a problem, a solution, and a question on: February 25, 2014, 07:05:06 pm
This was such an interesting idea that I have implemented it in Cosa. Please find the update of Cosa/Types.h and the example sketch in the Sandbox.

https://github.com/mikaelpatel/Cosa/blob/master/cores/cosa/Cosa/Types.h#L153
https://github.com/mikaelpatel/Cosa/blob/master/examples/Sandbox/CosaPSTR/CosaPSTR.ino

For more info on Cosa please see the github README and links to on-line documentation and blogg.

https://github.com/mikaelpatel/Cosa

Cheers!
118  Using Arduino / Networking, Protocols, and Devices / Re: SNMP Manager example code on: February 25, 2014, 03:35:17 pm
check http://forum.arduino.cc/index.php?topic=220756.0 cheers!
119  Using Arduino / Programming Questions / Re: The difference is returning a value which is very large on: February 25, 2014, 03:21:09 pm
Try:
Code:
vw_send((uint8_t *) &c, sizeof(c));
Cheers!
120  Using Arduino / Microcontrollers / Re: Using ATTiny84 with DS18B20 temp sensor as temperature logger on: February 25, 2014, 01:58:49 pm
There is a full example in the Cosa library that does all that. Download Cosa and install. Select the example sketch CosaDS18B20 and Cosa ATtiny84 as board. Compile and upload. All is included. You do not have to surf madly for libraries and cores. And there are tons of other classes to use. Fully integrated and compiles for all Arduino (AVR) boards, Mighty and Tiny.

https://github.com/mikaelpatel/Cosa
https://github.com/mikaelpatel/Cosa/blob/master/examples/OWI/CosaDS18B20/CosaDS18B20.ino

If you want to send the temperature readings wireless there is an example sketch for that.

https://github.com/mikaelpatel/Cosa/blob/master/examples/Wireless/CosaWirelessDS18B20/CosaWirelessDS18B20.ino

By changing a few lines in the sketch configuration you can change between RF433, CC1101 and NRF24L01+. More details on the blog.

Cheers.
Pages: 1 ... 6 7 [8] 9 10 ... 29