Quantcast
Channel: ThingSpeak IoT Community - Forum: Arduino
Viewing all articles
Browse latest Browse all 172

Sintra Air on DSM501a - Arduino

$
0
0

Hey!

 

It was printing.

 

Problem "kinda" solved.

It started posting information, but sometimes it just stops for radom 20 or 30min periods.

Maybe now related with the power supply, I think. Or arduino's memory. 

Next step: debug power supply.

 

I moved that part of the code on the void setup () 

to after all the ethernet operations before sending.

I think it might be related with timeouts.

 

//------ENC28J60----------
//if correct answer is not received then re-initialize ethernet module
//changed from 220 to 2800
if (res > 220){
initialize_ethernet();
}

res = res + 1;

ether.packetLoop(ether.packetReceive());

//200 res = 10 seconds (50ms each res)
if (res == 200) {

//_____________ TIME for DESPERATED MEASURES
dsm501.begin(MIN_WIN_SPAN);
dsm501.update();
int p=(dsm501.getPM25()/100);

// field1=(Field 1 Data)&field2=(Field 2 Data)&field3=(Field 3 Data)&field4=(Field 4 Data)&field5=(Field 5 Data)&field6=(Field 6 Data)&field7=(Field 7 Data)&field8=(Field 8 Data)&lat=(Latitude in Decimal Degrees)&long=(Longitude in Decimal Degrees)&elevation=(Elevation in meters)&status=(140 Character Message)
byte sd = stash.create();
stash.print("field1=");
stash.print(t);
stash.print("&field2=");
stash.print(h);
stash.print("&field3=");
stash.print(p);
stash.save();

 

I have lots of ideas, the problem is putting them to the practice.

Fortunately there are so many possibilities nowadays, and there is internet, the biggest library in the world =D


Viewing all articles
Browse latest Browse all 172

Trending Articles