Overdrivr / Telemetry

Data visualization and communication with embedded devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

transport.h is missing an include, causing compile error on some boards

bbkiwi opened this issue · comments

Thanks Rémi for this really this really useful library. I am trying to run the simple example code
on a arduino and get compiler error
testTelemetry:4: error: 'Telemetry' does not name a type
Telemetry TM;
Any suggestions as to what the problem is?
Thanks.

Hi, thanks!

Have you imported the library into the arduino library folder ?

The instructions are indicated here.

Let me know if that solves your issue

Hi Rémi,

Thanks for the quick response. The library is imported (if I search for Telemetry via Sketch->Include Library->Manager Libaries, I see Telemetry Version unknown INSTALLED). Also I've checked and in my libraries folder is a folder named Telemetry with the 7 .h files and 6 .cpp files.

I noticed that the files Telemetry.h and Telemetry.cpp use Window newline CRLF while the other files use unix LF. Also Windows could not extract from the .zip file giving error "The Compressed Folder ... is invalid. However 7-zip has no problem and in fact I used the IDE Sketch->Include Library->Add .ZIP Library to install it.

I'm using the Aduino IDE version 1.6.12 under Win 7 64bit. I tried compiling ex01_publish and got the errors attached. ErrorMessage.txt

Also if I select Sketch->Include Library->Telemetry these extra lines are added to the code:
#include <crc16.h> #include <dictionnary.h> #include <framing.h> #include <Telemetry.h> #include <telemetry_core.h> #include <telemetry_utils.h> #include <transport.h>
but with these the compile fails with the same error.

Allright I found the issue, I simply forgot to update this example! It is using the former interface.

I have updated it, now you don't need to instanciate a Telemetry object the library already does it for you.

See the updated example here.

It should fix your issue, let me know. And thank you for using Telemetry :)

Cheers

Hi Rémi, No luck :-) I am now getting errors in transport.h Error.txt which I think comes from HardwareSerial.h not being correct for my AVR (adafruit feather32u4). I have installed the Adafruit boards from their site, so maybe I need to go to their forum for help. If I tell the IDE to compile for other Arduino boards I get no error. Also if I comment out #include HardwareSerial.h" in transport.h then I get these errors when I compile for the Arduino boards.

I searched the Adafruit arduino forum and no one seems to have tried your library. Could there be a bug in Adafruits board description? I appreciate any suggestions of what I might ask.

Thanks for your time. Cheers,
PS If this is useful to you: The Adafruit boards that fail as above are all 32u4 with USB Serial support. Adafruit boards like Trinket baased on Attiny85 have no serial support and give this error testTelemetry:8: error: 'Serial' was not declared in this scope Serial.begin(9600); and the Adafruit boards like pro-Trinkets which have Serial but no serial to USB compile with no errors.

I can reproduce this issue, there seems to be an inconsistency with the
arduino build system, because running an arduino example with Serial in it
runs fine. I'll investigate and let you know quickly ;)

Le 18 nov. 2016 5:07 AM, "bbkiwi" notifications@github.com a écrit :

Hi Rémi, No luck :-) I am now getting errors in transport.h Error.txt
https://github.com/Overdrivr/Telemetry/files/598979/Error.txt which I
think comes from HardwareSerial.h not being correct for my AVR (adafruit
feather32u4). I have installed the Adafruit boards from their site, so
maybe I need to go to their forum for help. If I tell the IDE to compile
for other Arduino boards I get no error. Also if I comment out #include
HardwareSerial.h" in transport.h then I get these errors when I compile for
the Arduino boards.

I searched the Adafruit arduino forum and no one seems to have tried your
library. Could there be a bug in Adafruits board description? I appreciate
any suggestions of what I might ask.

Thanks for your time. Cheers,
PS If this is useful to you: The Adafruit boards that fail as above are
all 32u4 with USB Serial support. Adafruit boards like Trinket baased on
Attiny85 have no serial support and give this error testTelemetry:8:
error: 'Serial' was not declared in this scope Serial.begin(9600); and
the Adafruit boards like pro-Trinkets which have Serial but no serial to
USB compile with no errors.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#60 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABPB1Vp1zvpbDU6dE6eUiTeR5YysrpM6ks5q_SSWgaJpZM4K0pGr
.

Adding #include "Arduino.h" to Telemetry.h or transport.h solves the compilation error, I am not sure how it could compile without it in the first place.

For a quick fix, transport.h should look like this

#ifndef TELEMETRY_TRANSPORT_HPP_
#define TELEMETRY_TRANSPORT_HPP_

#include "Arduino.h"
#include "HardwareSerial.h"

int32_t read(uint8_t * buf, uint32_t sizeToRead)
{
// ...

I will make the updates in the repository as well. Please leave this ticket open, I'll close it when it's merged. Thanks

PS: Let me know if all your problems are solved

Hi Rémi, Thanks it is working now! It will be very useful for me. Great work :-) I was mainly interested in using the indexed plots and I have tested it with an example based on your sin plot example. As long as I keep the rate down it works fine. I have found that I must disconnect before trying to upoad from the IDE otherwise I get and error from the IDE. Sometimes when I disconnect the view it gives an error message, but disconnects anyway. I also discovered that I must shut down the plot windows otherwise when too many are open the whole thing bogs down. So yes all my problems (at least concerning Telemetry :-) ) are solved.