Category Archives: Embedded

Reyax GPS modules, first impression

I am having some com­men­ting pro­blems, not being able to com­ment my own posts, thus I enter this as a new post though it was meant as a com­ment on my pre­vious post about the Reyax GPS modu­les

The modu­les arri­ved two days ago, ship­ping from Reyax was really quick!

They work just as expec­ted, using u-blox u-center I can con­firm that the GNSS module is indeed the NEO-M8N (no surprise).

Run­ning u-center through Wine under Linux for a while, on a lap­top that will sus­pend every now and then, and using debug mode, I get a time accu­racy bet­ter than 25 ns (SD cur­rently about 2 ns). This is when the bre­ak­out board is pla­ced in a win­dow, with a view of less than half the sky, not set to sta­tio­nary mode, with SBAS enabled, and using both GPS and Glo­nass. That is, it is really not set up for opti­mal time accu­racy, but still I get really good results. I have not com­pa­red the results to my other u-blox module or any other GNSS.

u-center recently cras­hed (as some Win­doze pro­grams can do when try­ing to run them under Wine), so my sta­tistics were just reset, but with less than five minu­tes worth of data it claims a clock accu­racy bet­ter than 0.001 ppm (SD bet­ter than 0.0002 ppm).

I look for­ward to making an adap­tor card for using it with the RPi, and I hope to be able to place the whole combo out­side with a clear view of the sky. When I do, I will report back to you.

GPS module for a Stratum 1 NTP server using PPS

Some­time in early spring this year I setup up my own Stra­tum 1 NTP ser­ver using a GPS module with PPS out­put con­nec­ted to a Rasp­berry Pi. I took the easy way regar­ding the hard­ware, buy­ing a board made spe­ci­fi­cally for the RPi (not the newer B+ model) fea­tu­ring a u-blox MAX-7Q  module. It fits nicely in most RPi cases, and all you have to do is to con­nect an exter­nal antenna and make a small hole in the case for the antenna cable. The module is avai­lable from hab­supplies. It does cost about $60 (£36), so it is not cheap, but it works well and is very easy to use.

Most GPS modu­les I find on eBay only have four con­nec­tions, VCC, GND, RX and TX. It seems that the ubiqui­tous quadcop­ter con­trol systems are not expecting anyt­hing more, and the bulk of low price GPS modu­les seem to be tar­ge­ted on this part of the mar­ket. You can find the at good pri­ces, but to use them for an NTP ser­ver you would have to sol­der in some con­nec­tion for the PPS output.

The other day I came across somet­hing much bet­ter, GPS modu­les from Reyax, Tai­wan. They have a web site, but sell their pro­ducts in their store on eBay. They carry seve­ral GPS modu­les, with integ­ra­ted anten­nas, all with PPS out­put and more, cur­rent pri­ces range from $13.50 to $26.00.

Their cur­rent top model, the $26 RY825AI, fea­tu­res a u-blox NEO-M8N capable of receiving sig­nals from GPS, Glo­nass, Bei­Dou, QZSS ans SBAS (and when avai­lable, after a fir­m­ware update, Gali­leo too). It is not a spe­ci­a­li­zed timing module (such as the u-blox LEA-M8F), so the PPS pre­ci­sion is not quite as high as their timing counter­parts, but I guess that a PPS pre­ci­sion of 30 ns (RMS), 60 ns (99 %), is good enough for a home network NTP ser­ver. (The module used by hab­supplies is not a timing module eit­her, and I guess it has a simi­lar PPS pre­ci­sion.) Since you would want to turn off SBAS and stick to one pro­tocol, usu­ally GPS, when using the module for timing pur­po­ses, this one might be con­si­de­red over­kill. They do carry che­a­per modu­les that might do the job just as well, but then, why not go for the latest u-blox module, with a TCXO and upgra­de­able fir­m­ware. One cool fea­ture of the RY825AI is that it seems to be able to accept a USB con­nec­tion, using few exter­nal components.

I orde­red two of these RY825AI yes­ter­day, and I know that I will have to make some adap­ter card in order to con­nect it to  eg a Rasp­berry Pi, and that I will want to use the shor­test con­nec­tions pos­sible.  There are ways to tell the u-blox modu­les about the expec­ted delays in antenna cable (which is very short on these modu­les with integ­ra­ted antenna), cables to the des­ti­na­tion system, and soft­ware delay. Since we are dealing with nano­se­conds the speed of an electri­cal sig­nal in a cable can not be igno­red, if you want to pre­serve the ori­gi­nal precision.

I guess that a system with hig­her clock speed than the RPi would be more sui­ted for this appli­ca­tion, to fully take advan­tage of the poten­tial pre­ci­sion of the time data given.  But here too, for a dedi­ca­ted NTP ser­ver on my home network it will pro­bably do just fine. Since even the top Reyax model is less than half the price of the hab­supplies counter­part, I do not hesi­tate to give it a try.

Cur­rent link to the Reyax RY825AI on eBay. I am in no way affi­li­a­ted with them, I just found a good deal and want to share.

I do wish that CadSoft Eagle could help me with perfboard layout.

It’s not that Black­Board Cir­cuit Desig­ner is bad, but since I pre­fer to do sche­ma­tics in the free ver­sion of CadSoft Eagle I would love to be able to design and lay­out perf­boards  in Eagle, where I alre­ady have the sche­ma­tics and all.

If CadSoft were to include this fun­c­tio­na­lity I might con­si­der pay­ing for it, even though I strictly use it on a hobby basis.

AD9850 DDS Module part II

While cre­a­ting and veri­fy­ing the Eagle lib­rary which I wrote about ear­lier I found that my module rou­tes the main out­put, through a low­pass fil­ter, to pin 20 which is marked “ZOUT2”. The sig­nal source is actu­ally the chip pin 21, IOUT (not IOUTB). I find it a bit odd, but at least my module rou­tes its sig­nals that way.

Using my Eagle AD9850 module lib­rary I made a sche­ma­tic for a sig­nal source with a buf­fer amp­li­fier, and even though I have no plans on orde­ring a custom PCB I desig­ned a board for it too (manu­ally rou­ted). I often do that as it helps me find good ways to place the com­po­nents. Finally I used Black­Board Cir­cuit Desig­ner to plan the lay­out for a simple perf-board, try­ing to keep the sig­nal pat­h­ways as short as possible.

ant-analyzer-3-signal-gen-03-schant-analyzer-3-signal-gen-03-brd dds-02-composite-03

USB sound on Alix running Voyage

I thought that using a USB sound card with Linux would be easy, just plug and play, but I was wrong, it seems. Plug­ging in the Ter­ra­tec Aureon Dual USB (ID: 0ccd:0077) that I bought ren­de­red a pro­mi­sing out­put from dmesg and lsusb, and lsmod sho­wed that even rele­vant modu­les were loa­ded. The pro­blem was that mpd and other pro­grams did not find any way to actu­ally out­put sound to any device. They had the firm belief that my system was lac­king any sound card. Maybe I would need some sound rela­ted pac­ka­ges?

aptitude install alsa-base alsaplayer alsaplayer-text alsa-utils


No luck… The mpd con­fi­gu­ra­tion file /etc/mpd.conf see­med mostly con­fu­sing when it came to out­put devices, and the wiki page it refer­red to did not help eit­her. A search with Google on the USB ID was hel­p­ful though, as usual. Some­one with the alias BigRon also had pro­blems with Debian and this Ter­ra­tec USB sound card. The results from his attempts, docu­men­ted with ver­bose out­put, was simi­lar to mine. User bandan’s reply was the begin­ning of the end of my trouble! I had to edit /etc/modprobe.d/alsa-base.conf to com­ment out a line pre­ven­ting USB devices from becoming the first (default) device, sub­sti­tu­ting it for a line with the oppo­site effect.

## Keep snd-usb-audio from beeing loaded as first soundcard<br/> #options snd-usb-audio index=-2


# Fix from http://forum.doozan.com/read.php?2,4119,4166<br/>

  1. Allow snd-usb-audio to be loaded as first soundcard options snd-usb-audio index=0


    Now I was at least able to get alsa­mixer to ack­now­ledge the mere existence of a sound rela­ted device, but alas it chose an input only device (most likely my Logi­tech webcam with microp­hone) as the default device even though it cal­led the Ter­ra­tec one default by name. Luc­kily for me the just men­tio­ned forum thread linked to a more sub­stan­tial thread descri­bing the pro­blem in more depth. I added myself and the mpd user to the audio group, to make sure that there would not be any pro­blems with per­mis­sions regar­ding the devices

    addgroup jadler audio addgroup mpd audio


    I was still unable to play anyt­hing (wit­hout expli­citly cho­sing what Alsa refers to as sound card 1). So I kept try­ing the stuff that had worked for the per­son repor­ting in the forum, cre­a­ting an /etc/asound.conf file with basi­cally the same con­tent as sug­ges­ted in the last thread refer­red to above, but chan­ging all refe­rences to hw:0 to hw:1, and from card 0 to card 1. Now mplayer works, but I still can’t get mpd to do its thing.