sparkfun / phant-arduino Goto Github PK
View Code? Open in Web Editor NEWphant logging utility library for arduino
License: Other
phant logging utility library for arduino
License: Other
This doesn't seem like a bug with Phant, but possibly the Arduino String(String) constructor.
I'm running into a strange issue using the post method. I'm following this tutorial:
https://learn.sparkfun.com/tutorials/internet-datalogging-with-arduino-and-xbee-wifi
It uploads several pieces of information (temperature, methane level, etc) to a phant stream. As a test I set up a phant stream with temperature as the only parameter. I changed the arduino sketch accordingly and removed the phant.add lines except for temperature. As far as I can tell, none of that matters, but I figured I'd include it.
Temperature is a float so before calling post I'm calling add("temperature", float data). When I call post I'm returned a string with 0 length. If I change the return line of post from 'return String(result);' to 'return result;', I get the post string that I expect. If I call add("temperature", "string data"), it works either way. I don't know why Phant is constructing a new String when result is already a string, but I also don't see why it would matter...
I'm running Mac OS X 10.10.
When i try to compile my sketch for my Genuino MKR1000 (hackster edition), i get the following error:
C:\Users\***\Documents\arduino-1.6.8\libraries\phant-arduino-master\src\Phant.cpp:27:22: fatal error: pgmspace.h: No such file or directory
#include "pgmspace.h"
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino MKR1000.
When I try to compile on the Arduino Uno settings, it works fine. But I don't have an Uno...
After copying the pgmspace.h file to the C:***\arduino-1.6.8\libraries\phant-arduino-master\src folder the error changed to:
Arduino: 1.6.8 (Windows 7), Board:"Arduino/Genuino MKR1000"
C:\Users\***\Documents\arduino-1.6.8\libraries\phant-arduino-master\src\Phant.cpp: In member function 'void Phant::add(String, double)':
C:\Users\***\Documents\arduino-1.6.8\libraries\phant-arduino-master\src\Phant.cpp:152:26: error: 'dtostrf' was not declared in this scope
dtostrf(data, 1, 4, tmp);
^
C:\Users\***\Documents\arduino-1.6.8\libraries\phant-arduino-master\src\Phant.cpp: In member function 'void Phant::add(const __FlashStringHelper*, double)':
C:\Users\***\Documents\arduino-1.6.8\libraries\phant-arduino-master\src\Phant.cpp:162:26: error: 'dtostrf' was not declared in this scope
dtostrf(data, 1, 4, tmp);
^
C:\Users\***\Documents\arduino-1.6.8\libraries\phant-arduino-master\src\Phant.cpp: In member function 'void Phant::add(String, float)':
C:\Users\***\Documents\arduino-1.6.8\libraries\phant-arduino-master\src\Phant.cpp:174:26: error: 'dtostrf' was not declared in this scope
dtostrf(data, 1, 4, tmp);
^
C:\Users\***\Documents\arduino-1.6.8\libraries\phant-arduino-master\src\Phant.cpp: In member function 'void Phant::add(const __FlashStringHelper*, float)':
C:\Users\***\Documents\arduino-1.6.8\libraries\phant-arduino-master\src\Phant.cpp:184:26: error: 'dtostrf' was not declared in this scope
dtostrf(data, 1, 4, tmp);
^
exit status 1
Error compiling for board Arduino/Genuino MKR1000.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I hope anyone can help me!
Hello,
So Ive been trying to upload code onto my MKR1000 with the arduino software several times, yet I keep receiving the following error message which is driving me nuts.
Arduino: 1.8.3 (Mac OS X), Board: "Arduino/Genuino MKR1000"
fork/exec /Users/xxxxxx/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-g++: no such file or directory
Error compiling for board Arduino/Genuino MKR1000.
Can someone help me out?
I wish to have a command able to delete part of the dataset (e.g., using time range as input criteria), because many prototype project would have fiddling stage in between and that will produce some erroneous data. if user can manually delete these problematic data the quality of the data can be improved.
I am testing a data stream and I noticed something odd. My original stream had 10 fields, with 111 bytes of content. When I added a field, the content went to 118 and the stream failed in update. The additional field caused the packet to be malformed (400).
I recreated the database but with much shorter names. I was able to update all the way to the 15 field limit. The content was 87. When I add real values, this will be closer to 111 but for now, I can proceed.
Can you look to see if there is an issue around 300 ? The header itself has 190 so either phant is having a memory issue, or the Xbee is but something is corrupting the stream.
I made program with data does not come into the cloud when I copy test URL from the serial monitor, and paste the URL to explore, write the ok data to the cloud when I use the post, it does not ??
phant.add ( "bin_in", "post");
phant.add ( "bin_out", false);
phant.add ( "temp_1", 98.6);
phant.add ( "temp_2", 98.6);
phant.add ( "temp_3", 98.6);
Serial.println ( "---- ---- HTTP POST");
Serial.println (phant.post ());
client.println (phant.post ());
I use the library
#include <SPI.h>
#include <Ethernet.h>
#include <Phant.h>
I have used
Arduino UNO
Arduino Ethernet
---- HTTP POST ----
POST /input/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx.txt HTTP / 1.1
Host: data.sparkfun.com
Phant-Private-Key: zzzzzzzzzzzzzzzzzzzzzzzz
Connection: close
Content-Type: application / x-www-form-urlencoded
Content-Length: 66
bin_in = item & bin_out = 0 & temp_1 = 98.6000 and 98.6000 temp_2 = & temp_3 = 98.6000
Trying the example from https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/all#example-sketch-posting-to-phant
I'm using an official sparkfun esp8266 thing
I get 400 Bad Request with:
0 analog missing from sent data.
If I print the url to serial and copy paste it into my web browser, it works. I tried the edited code from issue 3 and it still doesn't work.
Whenever I send a string from the get() or clear() methods the server never replied and if I send another request in succession the server would reply with a "Bad Request".
I solved this problem by adding another '\n' to the last concatenation of both methods' strings:
changed
result += "Connection: close\n";
to
result += "Connection: close\n\n";
I'm using an XBee to send data up to data.sparkfun.com using the Phant library's post method. I always get an HTTP/1.0 400 error in response. In addition to sending the request through the XBee I print it out to the Serial monitor as well (I save the result from post() to a variable and send it to the XBee and then to the Serial monitor). The request looks fine, and in fact if I copy what's printed to the serial monitor and send it through netcat on my computer it works fine. This led me to assume something was going wrong in transit through the XBee, so I wanted to see exactly what the Phant server was getting. I started my own Phant server to see what exactly the server was getting, and the request goes through no problem. Any thoughts on what could be my problem?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.