This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windsensor questions
#1
Hi all, well winter has come and the boat is out of the water and my tinkering begins...
I am doing a rebuild of my windsensor/anchor light. the issues i found were.

cheap anemometers are to heavy with the rough chop on Lake Winnipeg they experience a lot of vibration and the weight was an issue. Fine for the back yard.

i have a new Davis sitting on my bench...

the NRF24L01 was fine, but did drop the odd packet at 5hz. will try again as the low power requirement was nice.  Or just put the nano in the boat and use usb to RPI as the Davis has a really long cord undecided at this point..
The Anchor light worked great. 

The nano was great as it can take raw 12 V power from 12 V bat bank.

Sean what Arduino are you using for your Weather sensor. I get fuse warnings?
I also get twi.h not found error? Not really an issue as i don't have a display or bme280.
I ordered a some new ones as i am sure they have issues.
ADMUX = _BV(REFS0) | 6; as i can understand this sets ADMUX to 01000000 | 00000110=
                                                                                                01000110  or  
AVCC on with pin A6 as source If I want to set the pin to A4  I would just change it to ADMUX = _BV(REFS0) | 4; or 01000100
I am having a issue understanding " AVcc with external capacitor"? where do i put this cap and what size?


After more testing my old auto pilot is to slow and dumb, I will probably change it as i really like Pypilot.
Sudjustions for a linear actuator would be welcome.
Reply
#2
Question:
Is there a reason why the buff is set to 128 as below

Code:
}

       char buf[128];
       snprintf(buf, sizeof buf, "ARMWV,%d.%02d,R,%d.%02d,N,A", (int)lpdir, (uint16_t)(lpdir*100.0)%100U, (int)knots, (int)(knots*100)%100);
       //        Serial.println(lpdir*100);
       //        Serial.println((int)(uint16_t)(lpdir*100.0)%100U);

       send_nmea(buf);

The reason i ask is because the max buffer size i can send with a nrf24l01 is 32 bytes smaller is betterSmile.
 
the general idea is have the Arduino send nmea to rpi via nrf24l01 when rpi gets request to change state of anchor light send 2 byte code to arduino that then changes state of pin controlling mosfet for anchor light and or some other task like change adjustment for wind vane.
 
The rpi will receive the nmea and forward it to a port and check state of pin or other request and transmit code to Arduino for action and then go back to receiving.
Reply
#3
(2018-11-29, 05:40 PM)ddelorme Wrote: Question:
Is there a reason why the buff is set to 128 as below

This device has 2k of ram, so 128 here doesn't matter. it is on the stack anyway, but 32 as you say should be just fine, but the result is the same.

Quote:the general idea is have the Arduino send nmea to rpi via nrf24l01 when rpi gets request to change state of anchor light send 2 byte code to arduino that then changes state of pin controlling mosfet for anchor light and or some other task like change adjustment for wind vane.
 

Not sure having this complication is needed for an anchor light. What about just having a switch that can apply 0, 6 or 12 volts up the mast? The anchor light only works with 12 volts (LEDS) but the arduino runs on either.
Reply
#4
(2018-12-02, 03:20 PM)seandepagnier Wrote:
(2018-11-29, 05:40 PM)ddelorme Wrote: Question:
Is there a reason why the buff is set to 128 as below

This device has 2k of ram, so 128 here doesn't matter.   it is on the stack anyway, but 32 as you say should be just fine, but the result is the same.

Quote:the general idea is have the Arduino send nmea to rpi via nrf24l01 when rpi gets request to change state of anchor light send 2 byte code to arduino that then changes state of pin controlling mosfet for anchor light and or some other task like change adjustment for wind vane.
 

Not sure having this complication is needed for an anchor light.   What about just having a switch that can apply 0, 6 or 12 volts up the mast?   The anchor light only works with 12 volts (LEDS)  but the arduino runs on either.

In my initial concept I wanted to reduce the wires going up the mast. The control unit/arduino and light are one unit with the wind instrument plugged into it.. Granted the mofset just removes one wire.
Besides it is fun to pull out my phone and turn my anchor light on and off when i drank to much to find my boat at a strange marina. Smile So no it is not critical for the Anchor light and if it breaks i will have to haul up a lantern.

I got the radio sending a nmea strings from the wind instrument and openPlotter receiving them with no timeouts.
I need to sort out how to write this out to kplex from the Rpi. So far I am having issues I need to sort out the socket stuff. I have a NMEA string "$ARMWV,325.35,R,0.00,N,A*2c" but I am having issues with sending the nmea string to a UDP port on localhost?
Reply
#5
Well I have it working the ESP32 is a bit different so i had to change stuff like interrupts and your method to get ADC reading. Wifi seems fine.
It would be nice to have a configuration page so i can do initial setup and change configuration for thing like ports, speed, compensation.. I have to test the wifi ota stuff better.
I started to think about a PCB board. Trying to change from Fritzing to Kicad...
Since this is mounted on the top of the mast I want waterproof connectors for the Davis. Finding a IP67 RJ11 jack is a pain.I might have to change to a small round 4 pin connector.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)