Jump to content

Banner.jpg.b83b14cd4142fe10848741bb2a14c66b.jpg

Arduino Focus control and Cloud sensor


ncjunk

Recommended Posts

  • Replies 490
  • Created
  • Last Reply

As per yesyes only the two files and using the "include" in the code.

Try with only those two files in the directory and make sure you havent left any copies of those files any where else in the arduino directory.

Link to comment
Share on other sites

OK been thru everything with a fine tooth comb and I only have one instance of ic2master installed D:\arduino\libraries\i2cmaster. 2 files in that directory i2cmaster.h & twimaster.cpp

twimaster.cpp has been edited:

#ifndef F_CPU

#define F_CPU 16000000UL

#endif

/* I2C clock in Hz */

#define SCL_CLOCK 50000L

Im still having the same problem, here's a screenshot....notice the #include <i2cmaster.h> is a different colour than the others

#include <LiquidCrystal.h>

#include <Stepper.h>

#include <Servo.h>

#include <i2cmaster.h>

post-13224-133877503799_thumb.jpg

Does this signify the driver is not being loaded?

Here's the error output:

Stepper_Easy_Driver_1_7_With_Cloud_detector_zip.cpp.o: In function `readMLXtemperature(int)':

D:\DOCUME~1\George\LOCALS~1\Temp\build2188857021688901750.tmp/Stepper_Easy_Driver_1_7_With_Cloud_detector_zip.cpp:366: undefined reference to `i2c_init()'

D:\DOCUME~1\George\LOCALS~1\Temp\build2188857021688901750.tmp/Stepper_Easy_Driver_1_7_With_Cloud_detector_zip.cpp:367: undefined reference to `i2c_start_wait(unsigned char)'

D:\DOCUME~1\George\LOCALS~1\Temp\build2188857021688901750.tmp/Stepper_Easy_Driver_1_7_With_Cloud_detector_zip.cpp:368: undefined reference to `i2c_write(unsigned char)'

D:\DOCUME~1\George\LOCALS~1\Temp\build2188857021688901750.tmp/Stepper_Easy_Driver_1_7_With_Cloud_detector_zip.cpp:370: undefined reference to `i2c_rep_start(unsigned char)'

D:\DOCUME~1\George\LOCALS~1\Temp\build2188857021688901750.tmp/Stepper_Easy_Driver_1_7_With_Cloud_detector_zip.cpp:371: undefined reference to `i2c_readAck()'

D:\DOCUME~1\George\LOCALS~1\Temp\build2188857021688901750.tmp/Stepper_Easy_Driver_1_7_With_Cloud_detector_zip.cpp:372: undefined reference to `i2c_readAck()'

D:\DOCUME~1\George\LOCALS~1\Temp\build2188857021688901750.tmp/Stepper_Easy_Driver_1_7_With_Cloud_detector_zip.cpp:373: undefined reference to `i2c_readNak()'

D:\DOCUME~1\George\LOCALS~1\Temp\build2188857021688901750.tmp/Stepper_Easy_Driver_1_7_With_Cloud_detector_zip.cpp:374: undefined reference to `i2c_stop()'

Why is the error output being called from a temp directory?

The working directory is D:\arduino\examples\SGL\Stepper_Easy_Driver_1_7_With_Cloud_detector_zip

Also tried compiling on my laptop with exactly the same results (silently screams) :):confused:;)

Link to comment
Share on other sites

In the meantime I have made more progress today.

I have installed Voyage Linux on an old VPN gateway box (Via C3 CPU, 512MB RAM, no VGA only serial port, 3 NICs) and installed mySQL, Apache, PHP and then Cacti onto that.

Then I configured the first graphs. I do get something (see attached screenshot) but for some reason it's far hotter at my place than in the Sun's core... :)

I guess it's a data format issue. It's either expecting 4 bytes and I send only 2 and it thinks they are the highest 2 bytes. Or I'm sending the value as a string and it interprets it as a number.

There is another issue where the Arduino resets when it receives an SNMP packet that it doesn't know what to do with.

I will look into this tomorrow. I've been given to understand that I've spend enough time fiddling today... ;)

post-14790-133877503819_thumb.jpg

Link to comment
Share on other sites

OK Im completely at a loss now, Ive installed everything on another machine that's never had the Arduino software installed and Im getting the same result, the i2cmaster library is just not getting picked up.

C:\arduino-0021\libraries\i2cmaster

C:\arduino-0021\hardware\i2cmaster

C:\arduino-0021\hardware\libraries\i2cmaster

Ive restarted the IDE on each occasion and even tried what this guy suggested in reply 25 Arduino Forum - Melexis SMBus IR Thermometer - NFI

Link to comment
Share on other sites

That is really odd. Mine just worked. Do you see the library in Sketch -> Import Library ?

Do you have other additional libs installed and do these work?

The screen shot I posted shows which library's are loading (orange), i2cmaster is greyed out.

post-13224-133877504046_thumb.jpg

Link to comment
Share on other sites

I'm a bit lost here. It just worked for me.

One thought I just had. Did you by any chance open the lib files in, say, wordpad and saved them? Or one of them? This would add some formatting but they need to be plain text files.

Link to comment
Share on other sites

I have made further progress today. It seems I have fixed both issues I mentioned.

The Agentuino SNMP lib does NOT like receiving another GET request before it has responded to the previous one. The workaround was to increase the time-out value to 1500ms in Cacti. This causes Cacti to wait 1.5 sec for a response (instead of the default 500ms) before re-transmitting the request. Since the Arduino does reply within 1.5 sec, Cacti does not need to re-transmit the request. With my current code the Arduino takes just under 1 sec to reply.

It would be nice if the lib could handle this a bit better. But I guess with 2kB of RAM, you can't buffer more than one packet?

The problem with the values being in the millions was solved by specifying "GAUGE" as the data type in Cacti. Before I used ABSOLUTE, which seems to interpret the data differently.

I have also cleaned up the code a little and commented some stuff. I also put a bit of repetitive code into functions (updating the LCD and reading the sensor values). Latest sketch attached.

post-14790-133877504069_thumb.jpg

Weather_Station.zip

Link to comment
Share on other sites

Well got it compiling and loading ;)

I changed the order of the lib files loading from this:

#include <LiquidCrystal.h>

#include <Stepper.h>

#include <Servo.h>

#include <i2cmaster.h>

to this

#include <i2cmaster.h>

#include <LiquidCrystal.h>

#include <Stepper.h>

#include <Servo.h>

Not sure why that worked but it has, no out put from the Melexis yet so I have to check that now :)

Link to comment
Share on other sites

Hmmm, I wonder if I could use the external sensors from a weather station like this:

USB Touchscreen Wireless Weather Forecaster Free Delivery : Professional Weather Station : Maplin

That's all the sensors I was thinking of adding (wind speed and direction, humidity, pressure and rain) and it would still be cheaper than buying the sensors separately. But I guess there is no way of knowing what interface they are using? Before buying I mean...

Link to comment
Share on other sites

Ha! Great minds...and all that. George has something similar and i just bought that very model and set it up today.

It works well...touch screen is a bit naff but it is what you expect for the price range.

The bundled software is ok but there is cumulus software which you can download and it can post data to the web.

I want to know if it is possible to tap into the wireless signals without using the base station....

It isnt accurate enough for the pro weather boys but i think should do the job for us.....plus i will know what the wind speed was whe my obs roof blows off next time!

Link to comment
Share on other sites

Hmmm, I wonder if I could use the external sensors from a weather station like this:

USB Touchscreen Wireless Weather Forecaster Free Delivery : Professional Weather Station : Maplin

That's all the sensors I was thinking of adding (wind speed and direction, humidity, pressure and rain) and it would still be cheaper than buying the sensors separately. But I guess there is no way of knowing what interface they are using? Before buying I mean...

Yes that's the one I have, I'm running Cumulus which is much nicer than the bundled software. Output from my weather station can be found here , There's lots of applets available including the one that puts my station weather in my signature :D

It should be quite easy to parse the output and use it as you wish, I bought my weather station so I have a accurate record of temperatures so I can match darks from my library with any imaging Im doing.

On another note.....Ive sorted the Arduino problems out :( Initially I was getting no output from the Melexis and soon discovered I had the 3.3v & ground wires soldered wrong way round :) I redid the circuit board hoping that the Melexis wasn't polarity sensitive.....it isn't and Im now getting output, ambient looks pretty accurate against my other thermometers in the observatory so no worries there.

Just waiting on Neil to re-package the SGL focuser/cloud software...hint...hint ;):D

Link to comment
Share on other sites

Hmmmmm....

This weather station is USB only I take it? So no way to read the values from an Arduino? Using a ready one would kind of defeat the objective of building my own one. I was just thinking of using the sensors on that pole. Doesn't have to be wireless.

I guess none of you had a look at what the sensors are? :)

Link to comment
Share on other sites

Oh and I have let the Arduino running since Sunday night and collected data from it into Cacti every 5 minutes.

Attached is the graphs for the last 24h.

The blue graph is the room/ambient temperature. The sensor is sitting on top of my external network hard drive so it's a bit warmer there. We don't have 28 degrees in our living room .. :)

The red graph is the temperature of the radiator the sensor is pointing at from about half a metre away.

And the green graph is the light level from the LDR. That in a dark-ish corner of the living room next to the desk and close to a small north facing window.

post-14790-133877504303_thumb.jpg

Link to comment
Share on other sites

That looks great YesYes :) its coming along nicely.

Im wondering with the weather station being wireless if it would be possible to capture the data as its streamed? In anycase the data is saved in txt and html format on the machine thats running Cumulus.

If you join the Cumulus forum there's lots of pictures of the innards of the sensors.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.