Show Posts
Pages: 1 2 3 [4] 5 6 ... 25
46  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 ;-)
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",

47  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;


PS: Don't forget to donate to Wikepedia. Support open information. DS.
48  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. Below is a snippet from the example sketch.
void loop()
  ThingSpeak::Channel channel(&client, KEY);
  ThingSpeak::Entry update;
  update.set_field(1, sensor.get_temperature(), 1);
  update.set_field(2, sensor.get_humidity(), 1);

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).


49  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!
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.

50  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.

51  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:

  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)

52  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.
It uses the Cosa DS1302 device driver and time class. It also demonstrates how to use the RAM on the device.

53  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.
int value = strtol(data, (char**) NULL, 2);
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.

54  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.

55  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.

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

56  Using Arduino / Networking, Protocols, and Devices / Re: SNMP Manager example code on: February 25, 2014, 03:35:17 pm
check cheers!
57  Using Arduino / Programming Questions / Re: The difference is returning a value which is very large on: February 25, 2014, 03:21:09 pm
vw_send((uint8_t *) &c, sizeof(c));
58  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.

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

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

59  Using Arduino / Sensors / Re: Use SPI with LMP91200 on: February 25, 2014, 01:44:11 pm
Ok, here is how you connect it.

Arduino      LMP91200 (PIN)
MISO          13 SDO_DIAG Serial Data Out /Diagnostic enable
Dx            14 CSB Chip select, low active.
SCK           15 SCLK Serial Clock
MOSI          16 SDI Serial Data In
Depending on which Arduino Board you intent to use the SPI pins are some what different. Check the Arduino Product Description for your board. The Dx is any Digital Pin that you want to use as chip select (active low). For Uno they are SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK).

Please note that my previous comment about MISO was wrong. You need to connect this as well to get data from the device. Now comes the fun part; writing a device driver. Remember it is 16-bit MSB first transfer (2 bytes). Good luck!
60  Development / Other Hardware Development / Re: 8MB Ramdisk for Arduino.. on: February 24, 2014, 09:39:22 am
That module would be interesting to rewrite the SD driver for. Also with some hardware the interface could be SPI and I guess that 16 MHz would not be a problem. With this size of device a file system is more or less necessary. With a SD driver interface the FAT16 library could be used (though a "format" function will be needed).

Do you have any numbers? What kind of access time? Byte/Block etc.

This would be great for very fast data loggers.

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