Menu

undefined reference to `calcbeaufortscale(float)'

Chad Gray
2021-11-30
2021-12-03
  • Chad Gray

    Chad Gray - 2021-11-30

    When i enable the Adafruit Windspeed option I run into an error. I don't think I am missing a library...

    Any input or help?

    Thanks!

    sketch\mySQMPLUS-122-4.ino.cpp.o:(.literal._Z15updatewindspeedv+0x10): undefined reference to calcbeaufortscale(float)' sketch\mySQMPLUS-122-4.ino.cpp.o: In functionupdatewindspeed()':
    C:\Users\cgray\Documents\Arduino\libraries\ArduinoJson\src/ArduinoJson/Deserialization/DeserializationError.hpp:20: undefined reference to `calcbeaufortscale(float)'
    collect2.exe: error: ld returned 1 exit status

     
  • Chad Gray

    Chad Gray - 2021-12-01

    It seems like the only windspeed devices that will compile are the bottom three.

    //#define WSPEEDSENSOR WSPEED_3DPRINT
    //#define WSPEEDSENSOR WSPEED_Anemon4403
    //#define WSPEEDSENSOR WSPEED_80422

     
  • brownrb

    brownrb - 2021-12-01

    in file windspeed.h line 102, change

    extern int calcbeaufortscale( float );

    to

    extern int calcbeaufortscale( double );

     
  • brownrb

    brownrb - 2021-12-02

    yes, but that diode is a 1N4728? It looks like something else

     
  • Chad Gray

    Chad Gray - 2021-12-02

    According to the package they came in yes. They are 1N4728.

    I did notice i am only getting 11.2volts going to the Adafruit wind speed.

    12.2 volts are coming into the MySQM PCB.

    I need to test more, but i do not get good consistent windspeed data. I have seen windspeed report back at 2mph a few times, but when i spin it the data is not responsive like the other data points.

     
  • brownrb

    brownrb - 2021-12-03

    Hi Chad

    First the voltages
    12.2 in but only 11.2 going to the adafruit wind speed sensor
    Yes, the 12.2v goes through the 1N5408 diode then to the lm voltage regulator
    The voltage for the adafruit comes from the out side of the 1n5408 diode/lm regulator

    As all diodes have a small voltage drop (around 1v) then 12.2 going in to the diode means 11.2 on the out side of the diode. So the values you see are normal.

    All the voltage type windspeed sensors have drawbacks.
    Primarily, windspeed is in relation to the output voltage.

    1. Changes in supply voltage can have a small effect on the voltage of the output signal
    2. The sqm+ or any controller for that matter, will not be able to give instantenous measurements

    Essentially what that means, is that the controller takes a snapshot in time of the sensor voltage.
    It is a snapshot in time.

    So any graph of any windpeed are snapshots in time, not occuring at some small precise interval.
    The Y axis being windspeed and the x axis being time.

    If that snapshot was occurring say 100 times a second, then one might say it is close to instantenous .

    But then, the controller would not do anything else but look after the windspeed.

    The sample rate in the mysqm+ controller is basically unknown, it depends on what other tasks needed to be done and how long they take. So you will never get some plotted graph curve showing a nice ramp up and slow down in speed when turning the sensor by hand. Rather is it a bar graph. Between the samples, we have no idea what the windspeed value is (or even extrapolate mid points). And the samples might be 10+ seconds apart.

    Windspeed is normally calculated be taking several measurements over a time span (and then averaged) because windspeed by its very nature is not constant,

    Have you tried running the TEST_WINDSPEED_ADAFRUIT.ino test program in the tests folder?

    if you delete line 85
    delay(2000);

    and then reprogram the controller, you then get as fast as it can go. You should be able to see the windup and slowdown in speed when turning it by hand.

    R

     
  • Chad Gray

    Chad Gray - 2021-12-03

    I un-hooked the signal wire and measured the voltage coming out of the windspeed meter.

    At stop i have .42 volts. I spin it with my fingers and got up to .9 volts. I don't know what speed that is.

    I put a fan in front of it and now i am getting 7mph (3.3m/s). So think it is working.

    I guess i was just expected more data when it was spinning slower. Here is a video
    https://youtu.be/vdof5nEjCms

    Thanks for all of the help! I will put it in the real world and compare to wind speeds that are "official".

    I am having a lot of fun with this project! Got my data hooked up to a MySQL database with an AllSky camera and graphing it with grafana.

    Chad

     
    • brownrb

      brownrb - 2021-12-03

      Hi Chad
      At stop, Adafruit defines the voltage to be around .4 volts so that is expected.
      You will find that for the adafruit sacrifises the sensivityt at low wind speeds in order to measure a higher wind speed maximum.

      A value of 0.4V 400mV represents no wind and 2V represents a wind speed of 32.4 m/s
      Each increase of 0.1V represents an increase of 2.025 m/s in wind speed, so you can there is no fine granularity. so from 0.4v = 0 speed to 0.5v results in 2ms/s

      Here is some additional information.

       

      Last edit: brownrb 2021-12-03
      • Chad Gray

        Chad Gray - 2021-12-03

        Ah! I seem what you mean about the lack of data on the low end. I guess i will be most curious of winds that are higher for astronomy and imaging anyway. It was that initial seeing 0mph that caused me to think it was not working and you appear to be displaying out to two decimals.

         
  • Chad Gray

    Chad Gray - 2021-12-03

    picture

     
  • brownrb

    brownrb - 2021-12-03

    That is pretty cool.
    Is it okay to add the photo to the PDF?

    v125-57 of firmware will be available shortly. Just finishing some of the testing.
    It will be a big leap forward compared to the previous firmware.

     
  • Chad Gray

    Chad Gray - 2021-12-03

    Here is a better one with a picture of the sky. You are welcome to use it. If i get a better one in the next few days when i put it out to measure the real world i will update you.

     

    Last edit: Chad Gray 2021-12-03

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.