tag:blogger.com,1999:blog-46518545773150497732024-02-07T10:30:45.625-08:00MadsenSoftMadsenSofthttp://www.blogger.com/profile/14363466556002008602noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-4651854577315049773.post-11131857316707103452014-11-14T07:10:00.002-08:002014-11-14T07:14:44.801-08:00<div>
<div>
<div>
<div>
<div>
<div>
<span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">Used a couple of rainy days to explore the GUI/scripting possibilities on Windows.</span></span></div>
<span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">
</span></span>
<span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">
</span></span><br />
<ul>
<li><span style="font-family: Arial,Helvetica,sans-serif;"><span class="im"><div>
Lua - wxLua. Very nice with Lua and all, but wxWidgets has a pretty steep learning curve. Also the resulting self contained binary would be rather large.</div>
</span></span></li>
</ul>
<span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">
</span></span>
<span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">
</span></span><br />
<ul>
<li><span style="font-family: Arial,Helvetica,sans-serif;"><span class="im"><div>
PowerShell - Some nice concepts, but just too horrible overall</div>
</span></span></li>
</ul>
<span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">
</span></span><br />
<ul>
<li><span style="font-family: Arial,Helvetica,sans-serif;"><span class="im"><div>
Autoit. - A BASIC variant and it shows. But a very nice set of tools with Gui builder, exe wrapper etc. good help files and rich library</div>
</span></span></li>
</ul>
<span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">
</span></span><br />
<div>
<span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">Autoit it was. And the resulting announcement to our wintering marina community can be seen below</span></span></div>
<span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">
<div>
<br /></div>
<hr />
<div>
<br /></div>
</span></span><span style="font-family: Arial,Helvetica,sans-serif;"><span class="im"><div>
After a couple of grey
days in the anchorage, a tool for downloading/viewing todays Skiron grib
file has magically emerged on my computer.</div>
</span></span><span style="font-family: Arial,Helvetica,sans-serif;">The Skiron grib files are kindly made available on <a href="http://wild-silk.org/en" target="_blank">http://wild-silk.org/en</a> by a fellow sailor and AFAICT are produced from much the same model as those on the <a href="http://poseidon.hcmr.gr/" target="_blank">Poseidon </a>web site. Only far more convenient as GRIB files ..</span></div>
<br />
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">This
may be a little over engineered, but basically pressing the Go! button
should suffice for most. The rest of the UI is hopefully relatively self
explanatory.</span></span></span></div>
<br />
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">For the technically inclined, the source code can be found at <a href="https://www.dropbox.com/s/m83yjzy9sln7z8v/skiron-grib.au3?dl=0" target="_blank">this link</a></span></span></span><br />
<br />
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span class="im"> </span><img class="CToWUd a6T" height="213" src="https://mail.google.com/mail/u/1/?ui=2&ik=fa04ae4009&view=fimg&th=149ae99478bfd833&attid=0.1&disp=emb&realattid=ii_i2hlqb0e0_149ae906c127ca36&attbid=ANGjdJ_YLNRtRTboqctI369pkPNM8iTHLhJLd8jLgeNHLSyd7O5fi8UItbWP_nOAbSkOjM_jZMNj5S9x1FnCsDk_21Sg6QUpTrl_YRQiuTg1tzylULfeuSCxn4jGY58&sz=w1600-h1000&ats=1415976422929&rm=149ae99478bfd833&zw&atsh=1" tabindex="0" width="403" /><br /></span></span></div>
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Due to restrictions in gmail you must download the program at <a href="https://www.dropbox.com/s/hznbyendtsr3oze/skiron-grib.exe?dl=0" target="_blank">this link</a>.</span></span></div>
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;"><span class="im">Just save it to somewhere on the computer and double-click.</span></span></span></div>
<br />
<span style="font-size: small;"><span style="font-family: Arial,Helvetica,sans-serif;">Enjoy /Flemming</span></span>MadsenSofthttp://www.blogger.com/profile/14363466556002008602noreply@blogger.com0tag:blogger.com,1999:blog-4651854577315049773.post-15248670834285581302012-10-15T09:11:00.002-07:002012-11-04T11:02:56.151-08:00Anchor winch remote - An exercise in futility<br />
<h4>
<span style="font-weight: normal;">Last spring, wanting to add another outlet for the anchorwinch remote I toasted the "up" by reversing the polarity in the socket. Bummer.</span></h4>
<div>
Taking it apart revealed two hexfet's, but replacing those didn't cut it. The remote has a button for "up", "down" and "on", so the simplest thing would have been to simply route the gates for the hexfets to ground through the "up" and "down" buttons. Could have been done with four 10k resistors beside the hexfets.</div>
<div>
<br /></div>
<div>
Alas that would leave the "on" button orphaned. The original functionality was to enable operation for one minute and lit an LED for that period when on was pressed.</div>
<div>
<br /></div>
<div>
Enter an attiny13, two more driving transistors with resistors, an LED and a voltage regulator. Not to speak of writing the program to control it all of course.</div>
<div>
<br /></div>
<div>
On button, I hope you feel pleased ...</div>
<div>
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ7Ku6GhXBNWYMfpkzQgCAo-auXOCMZ3FWZq2GmAIhVCr1nTL_aLBvZv4J9mryUTI0jLjZMIH2Y1fWPfvElcLpb_hPnTmuGFkeS1TbY5qeU7j9mZGddToAlQF0vBcohqqy0s3-7OPHvMs/s1600/1200-IMG_0357.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZ7Ku6GhXBNWYMfpkzQgCAo-auXOCMZ3FWZq2GmAIhVCr1nTL_aLBvZv4J9mryUTI0jLjZMIH2Y1fWPfvElcLpb_hPnTmuGFkeS1TbY5qeU7j9mZGddToAlQF0vBcohqqy0s3-7OPHvMs/s400/1200-IMG_0357.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Old PCB, New board, the remote and a test load on the left. At least the number of components is not as big as on the old one</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjcNNITLqBvmCPLYcr0ej23Wyw3La-9KeZqxUcKg74goeSRXm6QpDHD1ruznebwKzckWRsTkwu0eriIBuRt6SiRRKdQEf0DjC_0E10KQaSi5Pcw7B2luelpTKAN2B8LSTlRI1Aj1LMsws/s1600/1200-IMG_0359.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjcNNITLqBvmCPLYcr0ej23Wyw3La-9KeZqxUcKg74goeSRXm6QpDHD1ruznebwKzckWRsTkwu0eriIBuRt6SiRRKdQEf0DjC_0E10KQaSi5Pcw7B2luelpTKAN2B8LSTlRI1Aj1LMsws/s320/1200-IMG_0359.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Popping into place</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_3JgkxmkU6asNGTNlQErBFqV9hhPxU7_K_0_otR3Etx7yvHYXPa-_ANRmrFrXu36IYWZULuJ-Qun_MWoJuvegEJ62P-jZzq3sDNZ9VaySXKOZViQgTLyK6kzPfIGZ_hDiuUlxhXGdE6I/s1600/windlassRemote.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="438" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_3JgkxmkU6asNGTNlQErBFqV9hhPxU7_K_0_otR3Etx7yvHYXPa-_ANRmrFrXu36IYWZULuJ-Qun_MWoJuvegEJ62P-jZzq3sDNZ9VaySXKOZViQgTLyK6kzPfIGZ_hDiuUlxhXGdE6I/s640/windlassRemote.png" width="640" /></a></div>
<div>
<br /></div>
MadsenSofthttp://www.blogger.com/profile/14363466556002008602noreply@blogger.com0tag:blogger.com,1999:blog-4651854577315049773.post-52794590041226722962012-03-13T05:54:00.001-07:002012-03-13T05:58:20.330-07:00Boat project: AIS SART AlarmThis will be a small box to attach to your AIS receivers NMEA output. It will scan the output stream for type type 14 AIVDM messages coming from an <a href="http://en.wikipedia.org/wiki/AIS-SART" rel="nofollow" style="color: #551a8b;">Ais SART</a> such as the <a href="http://easyais.de/en/product_page.php?prodid=14" rel="nofollow" style="color: #551a8b;">easyRESCUE</a>. Alternatively MMSI numbers in the 970xxxxxx range will also trigger an alarm.
<br />
<div style="background-color: transparent;">
<div style="text-align: left;">
<br /></div>
</div>
<div style="background-color: transparent;">
<div style="text-align: left;">
The decoding is done with an Atmel ATtiny to roughly $ 1,- which will drive an LED and a piezo buzzer. A pushbutton is attached to an input pin.</div>
</div>
<div style="background-color: transparent;">
<ul>
<li><div style="text-align: left;">
<span style="background-color: transparent;">During normal operation the LED will blink slowly when AIS messages are seen.</span></div>
A push button press will test the buzzer.</li>
<li>When a SART transmission is detected, the LED will blink fast and the buzzer is activated.<br />A pushbutton press will disable the buzzer, but the LED will keep blinking fast.<br />Additional presses will toggle the buzzer.</li>
<li>When the SART in question (by MMSI) stops transmitting, the buzzer will be re-armed.</li>
</ul>
<div style="background-color: transparent;">
This can all be built for appx. ten dollars. AIS SART detectors retail for about 500 ...</div>
</div>
<div style="background-color: transparent;">
<br /></div>
<div style="background-color: transparent;">
Watch this space for a diagram coming up soon.</div>MadsenSofthttp://www.blogger.com/profile/14363466556002008602noreply@blogger.com0tag:blogger.com,1999:blog-4651854577315049773.post-73223434644528294062012-03-13T05:52:00.001-07:002012-03-13T13:20:24.698-07:00Boat project: Autopilot remote and MOB FOBLots of people are sailing around with Autohelm autopilots, for which no wireless remotes are available (to my knowledge anyway).<br />
<div style="background-color: transparent;">
<br /></div>
<div style="background-color: transparent;">
Hobby sites like sparkfun.com and lipoly.de sells a <a href="http://www.lipoly.de/index.php?main_page=product_info&products_id=104936" target="_blank">wireless fob</a> for the 2.4 GHz band that fits the bill nicely with 5 buttons and a programmable Atmel ATtiny 24 on board. On the receiver end, another Avr talks to the receiver radio and the <a href="http://www.thomasknauf.de/seatalk.htm" rel="nofollow" style="color: #551a8b;" target="_blank">Seatalk</a> bus.</div>
<div style="background-color: transparent;">
<br /></div>
<div style="background-color: transparent;">
The 5 available buttons may be laid out like:</div>
<div style="background-color: transparent;">
<ul>
<li>Left: Port 1 degree</li>
<li>Mid + Left or Up: Port 10 degrees.</li>
<li>Right: Starboard 1 degree</li>
<li>Mid + Right or Down: Stb. 10 degrees.</li>
<li>2 Mid presses followed by left/right within 3 secs: Tack 100 degrees.<br />This will be given as 10x10 degree commands on the bus to suit all pilot types.</li>
<li>The receiver Avr will listen on a uart for GPS XTE (Cross track error) NMEA commands.</li>
<li>A switch will determine whether these should be used for driving the autopilot from the active route in the GPS.</li>
</ul>
<div style="background-color: transparent;">
In addition the remotes can be used as MOB FOB's:</div>
</div>
<div style="background-color: transparent;">
<ul>
<li>The att24's watchdog is used to wakeup the uC and send a keepalive message every 30 secs.</li>
<li>If the signal does not arrive (because the FOB drowned by going overboard) the receiver will issue an alarm as for the AIS SART.</li>
<li>Some kind of procedure for signing the FOB's in and out needs to be devised. ??<br />Maybe provide a USB socket (In AVR Firmware) (com port) and and a windows app?</li>
<li>When reproprogramming the att24 in the FOB, a serial number must be flashed in.</li>
</ul>
</div>MadsenSofthttp://www.blogger.com/profile/14363466556002008602noreply@blogger.com0tag:blogger.com,1999:blog-4651854577315049773.post-62091380613156020202012-03-08T11:26:00.004-08:002012-10-15T08:54:23.643-07:00A Microscopic Event Lib<br />
Many years ago, an extremely able colleague of mine introduced me to what could be called Asynchronous Programming. From GUI programming, we know the notion of callback registering and execution. When applying this principle to streams and time as well, programs can handle (seeming) concurrency just as responsive as using threading. I have never looked back ..<br />
<br />
Although I rate myself as pretty good at managing preemptive concurrency, I *hate* the added complexity of protecting all shared data. And last but not least, the flow of execution is much easier to grasp when all callbacks run to completion before falling back into the main loop.<br />
<br />
The catch of course, is that *everything* needs to asynchronous. Ie. all operations must complete in a short amount of time, or be arranged so that a callback is called upon completion. Also factoring everything into callbacks can be tedious in a language like C that doesn't have anonymous functions, let alone closures.<br />
<br />
This of course has been realized by brighter minds already, and that is why <a href="http://libevent.org/">libevent</a> exists. However this is a relatively heavyweight, certainly in embedded Linux where megabytes of storage can be counted on one hand.<br />
<br />
And this is why the micro event lib (libuevent) came into being. The tediousness of C is addressed with a <a href="http://lua.org/">Lua</a> binding. Lua of course has closures, so this style of coding becomes next to effortless.<br />
<br />
Go check it out on <a href="https://code.google.com/p/libuevent/" target="_blank">GoogleCode</a> ..<br />
<br />
/Flemming<br />
<div>
<br /></div>
MadsenSofthttp://www.blogger.com/profile/14363466556002008602noreply@blogger.com0