OpenMarine
weathersensors - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: Pypilot (https://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: weathersensors (/showthread.php?tid=1810)

Pages: 1 2


weathersensors - svBlueMoon - 2019-05-19

I'm trying to build the weather sensor in the "arduino" section. Being fairly green at compiling code I can't resolve a complie error in the IDE.
Running the compiler I get "~\arduino\weathersensors\weathersensors.ino:34:19: fatal error: twi.h: No such file or directory

   #include <twi.h>"



I'm sure it's the line 33
"extern "C" {

  #include <twi.h>
}"

Snooping through othere files I saw a comment that the built-in twi.h in the arduino wire library doesn't do a required pull-up needed.
That's where the greenneess takes over. Where is it lookng for this file and how do I go about installing all the dependancies required? I ran the makefile (another foggy area) but that didn't resolve the issue. 


Thanks for any help.
DanO


RE: weathersensors - seandepagnier - 2019-05-19

it should be checked into the repository. So I recommend you try running "make" from the command line for the weather sensors so they can use the right twi.

I gave up on the arduino ide years ago.

Sean


RE: weathersensors - abarrow - 2019-05-19

If you have the library as a zip file, go to Sketch - Include Library - Add ZIP Library... and load the zip file. It will be put in your sketchbook/libraries folder and can be used with the #include <whatever> syntax. If your include file is in the same directory as your source code, you would use the #include "whatever" syntax. You can open a new tab in the Arduino IDE and cut/paste your include file there, which is particularly useful if you intend to do modifications to that code. You would use #include "whatever" for that, and the include file will be saved in the same folder as your source code.

You don't have to use the Add Zip Library... menu to add libraries. It is also okay to just unzip the new libraries into your sketchbook/libraries folder and restart the Arduino IDE.

While I continue to use the Arduino IDE, I agree with Sean that for really advanced stuff the Arduino IDE leaves a lot to be desired. For your weather station, I'm sure it'll be fine. The next step to another IDE is a BIG step, particularly if you are on a steep learning curve.

Andy


RE: weathersensors - jim321 - 2019-05-19

if you still want to use the arduino ide then create a new tab copy paste this to it.
https://raw.githubusercontent.com/pypilot/pypilot/master/arduino/weathersensors/twi.c
example of a new tab
   
try to compile again.
see if that works..


RE: weathersensors - svBlueMoon - 2019-05-22

Dumping the IDE gets me past the twi issuse but running make stops with "No rule to make target 'font.ttf' , needed by 'charset.h' . Stop."

What am I missing now? The file isn't in the pypilot files downloaded and I don't see anything that builds it.

Thanks guys for all your help/guidance.

(2019-05-19, 02:10 PM)abarrow Wrote: If you have the library as a zip file, go to Sketch - Include Library - Add ZIP Library... and load the zip file. It will be put in your sketchbook/libraries folder and can be used with the #include <whatever> syntax. If your include file is in the same directory as your source code, you would use the #include "whatever" syntax. You can open a new tab in the Arduino IDE and cut/paste your include file there, which is particularly useful if you intend to do modifications to that code. You would use #include "whatever" for that, and the include file will be saved in the same folder as your source code.

You don't have to use the Add Zip Library... menu to add libraries. It is also okay to just unzip the new libraries into your sketchbook/libraries folder and restart the Arduino IDE.

While I continue to use the Arduino IDE, I agree with Sean that for really advanced stuff the Arduino IDE leaves a lot to be desired. For your weather station, I'm sure it'll be fine. The next step to another IDE is a BIG step, particularly if you are on a steep learning curve.

Andy

It's a steep learning curve while standing on the shoulders of giants, but a freaking vertical wall when I get down!


RE: weathersensors - seandepagnier - 2019-05-28

The data repository contains font.ttf used.

https://github.com/pypilot/pypilot_data


RE: weathersensors - svBlueMoon - 2019-06-05

(2019-05-28, 12:02 AM)seandepagnier Wrote: The data repository contains font.ttf used.

https://github.com/pypilot/pypilot_data

Thanks Sean,
"Make" ran without errors but didn't upload to the arduino.... (checked and it was the correct USB port???)
That's fine I'll figure that out as I continue to wean myself off MS Windows.
I did get the hex file though and used another utility to write it to the nano. I have a functoning wind instrument now just needs to be strappen on the mast.
Thanks again.

DanO


RE: weathersensors - conifer - 2021-07-25

I'm trying to update the weathersensors.ino code to interface with an HC-12 transceiver.

I'm having the same issue - unable to find twi.h.




I tried running make from the weathersensors directory and got 
make: *** No rule to make target `/usr/share/arduino/libraries/Wire/Wire.o', needed by `weathersensors.cpp.elf'.  Stop. 


I also tried copying the twi.c code into a new tab, but got an error because my working directory already contains the twi.c code. 
Note that I only copied the weathersensors directory from the pypilot-master.
This is with a fresh Arduino install with minimal external libraries installed. Some research suggests that twi.h may be included in some external libraries? It's not in the pypilot library on github.
Any other suggestions?
Mac OS Big Sur 11.4.


RE: weathersensors - seandepagnier - 2021-07-26

I had to modify twi slightly which is the reason I could not include it from external sources

You may need to update the makefile or create a symlink to point /usr/share/arduino to your arduino install


RE: weathersensors - xiano - 2022-10-21

I had quite a hard time getting weathersensors.ino to compile...
After days of struggle, I found a solution that works for me.

All I had to do, was to change line 35 from:

Code:
extern "C" {
 #include <twi.h>
}

to:

Code:
extern "C" {
 #include "twi.h"
}