Home

Embedded Computer Including Software for the Intelligent Bird

image

Contents

1. MaX MCC Linux eslAppCtrl adc appctrl Y sensors ueyeusbd postprocessor irBarrier I appmgr M appmgr L elb149c5m l vvvvvvvvv hmi eslLog ueyerec D ueyerec F Wifi http lt _ gt LE mcfsd ftp Figure 22 Birdhouse application processes tasks communication diagram In MQX each block represents one task In Linux each block represents one process Grey blocks represent third party tasks processes Tasks labelled in grey italics were not implemented Legend 1 a starts b 2 Client server communication a being a client of b 3 a controls b 4 a sends data to b appmgr plays the superior role in the communication based on the client server model appmgr being the client and appmgr being the server The communication protocol for the three most important operations is defined in Table 1 The client always starts the communication by sending a message of given type Each message can further contain Param iParam2 iParam3 and uParam parameters WAKEUP SLEEP RECORD RECORD FINISH and ACK message types and MCC OK and MCC ERROR return codes are defined appmgr is basically an event processor which after initialization cycles in an endless loop as depicted in Figure 23 There are three main event types SLEEP WAKEUP and RECORD After an event is detected appropria
2. 10HLNOD Volang WWOS ODIN TOZ 8 ald say aua Z ES O TA TOZ6 i Pd SZ 01519 Poisoned E E i i aor ot hor voor len 3 STV43Hd Mad Em we 1138 ed f ld seti os pio jo b bre IE XR IM Tad T tru ja 10 p ymm C vam Lig P EN 28 xa tT wee cni ct eut euer Jeuse vans z 8 a vaw oni Ll za Los Hora z 8 ES Lk zaw B z ash au Z i 5 EE ipe E s No i o 8 a sap NUM 1noa Fe Omar bags Tan f ba a gms ro e axa eese Er NI noru fzr gt xuw a timas x xi NON gt 8 a P ocu a a noe ne hr xi inai 9ea sbi cuin i US Et ii Ca TIT ezsa pr LOL NEL hr lt au E 4 2 E 3 J3NU3H 1 a E E z A E M n i M n E uoo o ELE ZE uoo oor LI c5 po gt K an 955 eo T SKRAR 8 A4 0 4 S SENN 8 8 4092555 282382588 28232558 El ooi Bes 8 a 3 38 P a SS 05 38 g B g B ma HE GNE A A AA PS 09TH0S00000S2 909TH0S00000SZ A09TH0S00000SZ A09TH0S00000SZ 409THOS00000SZ A09THOS00000S2 A aaa ZEZ Dd 7 E E E EH E E R F OU 3 F F B E E E OOSQQSCUOOiMOSOOQ0OSCL OOtHOSODQQOS LEOO HOSODQI0SCLROSLHOSODQIO0SLEOSL OSODQD0S CL ACER i oc eee Re RE CET TRE EE RE RC s eee 2 ote eS o YYYYYYYYYYYY VYY ka 3 ka 3 ha 3 la Joa k a 4 sa A da ogsn Na ossn gt da tasn Nd tssn vas ei LO DS Ux DD Tam Dam old x Por 020149 T QI DT t0 Lo zou net y amp uoi Javod asn m were voor n w sp TE m gesozsaL wn Jw g zno an9 x To AS uno NI
3. Key Allowed Description Values sleep enable 0 or 1 Use 1 to enable the power saving SLEEP mode when the video recording is disabled Use 0 to disable it sleep hour 0 to 23 Hour and minute of the day when to switch to SLEEP sleep__minute 0 to 59 mode sleep_ enable must be 1 to take effect wakeup hour 0 to 23 Hour and minute of the day when to switch to READY wakeup minute 0 to 59 mode sleep enable must be 1 to take effect battery low 1 to 13000 Battery voltage in millivolts when to warn about low volt age battery verylow 1 to 13000 Battery voltage in millivolts when to halt the system battery critical 1 to 13000 Battery voltage in millivolts when to turn off the system Table 4 mqz cfg configuration keys description 51 5 Implementation The default content of the linux cfg file is as follows Door camera settings dcam sensor gain lt 0 100 gt increment to increase sensitivity gain 10 camera exposure lt 0 5 50 0 gt ms increment to increase lightness exposure 6 0 number of frames per second lt 0 1 10 0 gt fps framerate 10 0 video record duration lt 0 1 300 0 gt s duration 3 0 Floor camera settings fcam sensor gain lt 0 100 gt increment to increase sensitivity gain 10 camera exposure lt 0 5 50 0 gt ms increment to increase lightness exposure 6 0 number of frames per second lt 0 1 10 0 gt fps framerate 1 0 vid
4. 43 5 Implementation The Linux kernel several tools and the whole distribution can be configured using the menuconfig tool accessible as a Makefile target It provides a semi graphical inter face for easy interactive configuration see Figure 37 of config files containing complex information about packages to be built and their options together with dependency resolution simple search and help Linux arm 3 0 15 ts armv7l Kernel Configuration Arrow keys navigate the menu Enter selects submenus Highlighted letters are hotkeys Pressing Y includes N excludes M modularizes features Press lt Esc gt lt Esc gt to exit for Help lt gt for Search Legend built in excluded M module lt gt module capable Patch physical to virtual translations at runtime EXPERIMENTAL General setup Enable loadable module support gt Enable the block layer gt System Type gt pp Kernel Features gt Boot options gt CPU Power Management gt Floating point emulation Userspace binary formats Power management options Networking support gt Device Drivers File systems Kernel hacking Security options gt Cryptographic API Library routines gt Load an Alternate Configuration File Save an Alternate Configuration File lt Exit gt lt Help gt Figure 37 Screenshot of the menuconfig utility when
5. x 3 a 2 e E 90 70 50 30 100 10 30 50 70 90 21012 o 16972 1 A Wavelength nm Angle Figure 11 TSHG5510 HighSpeed Infrared Emitting Diode Left Relative Radiant Power vs Wavelength Right Relative Radiant Intensity vs Angular Displacement From 12 4 1 4 RFID Reader Monitored owls are tagged with an RFID chip M4200 It can be scanned by vari ous commercially available RFID readers The product ELB149C5M by Seeed Studio see Figure 12 was found at 13 to be appropriate for this task First it has relatively low power consumption approx 30 mA 5 V second it has a modular construction with a simple communication interface UART baud rate 9600 bits per second bps TTL output 14 so it can be easily integrated into the system and finally it is available for a very reasonable price The module is distributed with an external antenna which cannot be used though A circular antenna around the fly in hole similar to the one used in the referential design see Section 3 3 needed to be manufactured Its dimensions are depicted in Figure 13 14 4 1 Hardware Figure 13 Custom RFID antenna dimensions requirements Distances are in millimetres Edited drawing by the ornithologists 4 1 5 Light Barrier The light barrier is an important part of the system functioning as the event trigger It is a device consisting of one transmitter and one receiver Transmitter is typically a LED usua
6. generates 90 frames of one record which is still more then 71 The final step of this workaround is to use both image formats PGM for the door camera short records high frame rate and JPEG for the floor camera long records low frame rate Following this schema one record with default configuration takes approximately 30 x 1 31 60 x 0 15 48 3 MB The reserve space provides enough freedom for performing future configuration changes ueyerec D ueyerec F 0001 pgm 0001 jpg appmgr L postprocessor data txt floor log SDCARD Figure 39 Illustration of flow of the recorded data 48 5 2 Software The output image files serve as input for the postprocessor whose task is to convert a sequence of images into a video file It is the bash script video encode tmp sh located in the root directory lt DVD gt sdcard rfs overlay root see Appendix A It is run by the appmgr separately for each camera at the time when the camera stops recording The script basically runs ffmpeg tool which does all the video encoding job and produces an AVI file door avi or floor avi for the door camera or floor camera respectively and a log file appmgr creates file data txt containing the date and time of the record scanned RFID code or NONE if no code scanned internal and external temperature and ambient light value from 0 to 4095 0 being absolute dark 4095 absolute light all the values rec
7. English In Journal of Ornithology 151 2 2010 pp 507 512 ISSN 0021 8375 DOI 10 1007 s10336 009 0480 5 URL http dx doi org 10 1007 s10336 009 0480 5 V Bezou ka P D d and M Drd kov The automatics system for monitoring of owls nesting In ITCE 2005 Conference abstracts CZU TF Praha 2005 pp 173 182 Mark ta Z rybnick and Ji Vojar Effect of male provisioning on the parental behavior of female Boreal Owls Aegolius funereus English In Zoological Studies 52 1 2013 pp 1 8 DOI 10 1186 1810 522X 52 36 URL http dx doi org 10 1186 1810 522X 52 36 Kotl n Senzory s r o Kotl n Senzory s r o KS96 IRVO Czech URL http www kotlin cz image php Akce detail amp id 521 amp url cs snimace opticke vyhledavani opticke amp KeepThis true amp TB iframe true amp height 600 amp width 800 visited on 04 03 2014 Petr Kubiz k Po ta ov syst m pro sledov n hn zd n sov Zpr va k p edm tu 4A4M33SVP Czech Cesk vysok u en technick v Praze 2013 Freescale Semiconductor VF6xx Vybrid family with ARM R Cortex TM A5 Corter M4 1 5MB SRAM LCD security 2x Ethernet L2 switch URL http www freescale com webapp sps site prod summary jsp code VF6xx visited on 04 04 2014 Elnico s r o SQM4 VF6 W URL http www sgm4 com sagm4 vf6 vybrid module wifi visited on 04 04 2014 IDS Imaging UI 1541LE uEye LE USB 2 cameras URL http en ids imaging
8. com store produkte kameras usb 2 0 kameras ueye le ui 1541le html visited on 07 04 2013 63 Bibliography 12 13 14 15 16 17 18 19 20 21 22 25 26 27 64 Vishay TSHG5510 High Speed Infrared Emitting Diode 830 nm GaAlAs Double Hetero Version 1 2 Aug 23 2011 URL http www vishay com docs 81887 tshg5510 pdf HW Kitchen Electronic Brick 125K Hz RFID Card Reader URL http www hwkitchen com products electronic brick 125khz rfid card reader visited on 07 08 2013 Seeed Studio Works 125K RFID READER Version 1 01 Sept 20 2010 URL http www eio com admin images Downloads 125K 20RFID 20Reader 20v0 9b pdf visited on 04 15 2014 Vishay TSSP58038 IR Receiver Module for Light Barrier Systems Version 1 0 Mar 13 2012 URL http www vishay com docs 82479 tssp58038 pdf Vishay TSAL5100 High Power Infrared Emitting Diode 940 nm GaAlAs GaAs Version 1 7 Aug 24 2011 URL http www vishay com docs 81007 tsal5100 pdf Microchip MCP9804 0 25 C Typical Accuracy Digital Temperature Sensor Nov 29 2011 URL http wwi1 microchip com downloads en DeviceDoc 22203C pdf Qualcomm Atheros AR4100 System in Package 802 11n General Availability Data Sheet Version 5 0 MKG 16487 Apr 2012 URL http www freescale com files wireless comm doc data sheet AR4100 DataSheet pdf Wikipedia Real time comput
9. gamma saturation frame rate image preprocessing e Capturing capture mode setting capture control event handling e Storing single frames loading and saving to the file system e External communication General Purpose Input Output GPIO and flash con trol I C communication MCC Library The Multi Core Communication library MCC is a subsystem which enables com munication of applications running on different cores of multicore processors Each communication channel consists of two message queues stored in the shared RAM signalization is realized by interrupts and exclusive access by hardware semaphores That ensures a lightweight and fast communication with simple blocking non blocking send receive API calls 30 22 4 2 Software The library supports MQX and Linux operating systems allowing for either MOX to MAX or MQX to Linux communication It is developed by Freescale and Timesys In MQX it is shipped as part of the MAX distribution In Linux the library can be fetched from a repository It operates in the kernel space being injected to the Linux kernel as the kmod mcc kernel module developed by Timesys This communication layer is a fundamental part of the Birdhouse project allowing for dual core MQX Linux implementation ESL Library The Elnico Support Library ESL is a middleware framework built on top of MOX version 4 It is developed by Elnico as a support software for their Kinetis and Vybri
10. i E za v E ton Er oz 089011 B 1 PRA s xz C3wowsaes d m I nad Se Nisa omn Niasa i i zal sai X zu Pd 9 Hl L i VS i VWS T AZT 7 i SOSNAS FINAL OL VSTEAS AZT Add MIS HAMOJONIHOLIMS 79 Appendix B Schematics B 2 BudkaLighting Schematics of the camera infrared lighting board named BudkaLighting SNILHOTI wang OOINT3 vtoc v pe oid lisa eug I TA 9ZIBA OSO vToz y po 3soujeld T T pouuo3 pue a JeD0d AA0X 83 A9ZEN 1 o sp sn JN ort asn AS rD ee diNV IO ANYZ U00T yr 8x OT TFIOHLN Xx CO 1 ZOHAN x O ZOHAN SC Ac u00T TT HO x ZNOH LIA O ex ZOHAN p ZOHAN ZTIOHIM Vd4WV3 lt gt Ix ZJIOHLN 3SVO OL 82d ys zst gt on auis etm ou HOST ES z x m ko Ww jorssWosi oTssRoSL 0TSSMOSL OTSS OSL 0TSSHOSL x A KA A TAS Td gra 6a 9a ta Lear R Jorsshos1 orssMos1 jorssMosi OTSSPOSL OTSSHOSL OTWAS 8vToNT x A x x A Cer Y ne Y Ta Tta sa sa za saj OD maf a rss orssros ovesi orcomst oreen OTSSMOSL OTSSROSL OTSSMOSL OTSSOSL OTSSMOSL wani x x x x x x A TG Ta za va Ta TG uot dot ov 46b y6b yov SH vH ed a Tu 8H eif M AS usvid 76 B 3 BudkaIRBar B 3 BudkalRBar Schematics of the infrared light barrier board named BudkalRBar Jegy 1 voang O INT ETOZ TT pa 01d ISSA DU TTA ETOZ TT 1 ZI A O SID
11. po 3sou3eld T T pauuo pue G31 jeD0d Ano Ia A9ZEN ojsp 3S1 O ex ZTIOHIW O vx ZANTOHIN god OL d18VO Aic u00T eo ex ZOHAN TX c3 1OH IA ASV OL 82d GND 1931308 O3440318 AS vl M 8E08SdSSL Ta eI EE67434 NOA SSA NIA TT Appendix B Schematics B 4 BudkaLTS Schematics of the temperature and light sensors board named BudkaLT S SIT wana OOINTA eTOZ OT polold ISA eug 0 T ZA OSD ETOZ OT po ISOUJE d T T pauuo pue 31 78000 Aki ADZEN 0 5D 35 9L SL ad OL d18VO X00T 8u SduON Tu s TEZE fv Q ENV Ss te E 62438 TAM vas iz en pales SSDIPPY uo La MAT OV bl vas Ds NEE WOT 99 V za 8bTbNT GND vas ZI TOS ZI AST 78 Appendix C Printed Circuit Boards Board routings and silkscreens of the printed circuit boards assembled by Elnico s r o 79 C 1 BudkaControl Appendix C Printed Circuit Boards C 2 BudkaLighting Routings and silkscreens of the camera infrared lighting board named BudkaLighting 0 BudkaLighting Figure 50 Board routing layer top Figure 51 Board routing layer bottom 82 C 2 BudkaLighting X5
12. 21 28 40 2014 RFID 3774526282 Temperature internal 19 50 C Temperature external 255 75 C Ambient light 2 The following record 20140416 212919 941 comes the very next moment at 21 29 19 when the male brings a prey a kind of rodent The door camera recorded the male transmitting the prey to the female Figure 46 left image while the floor camera cap tured the female placing the food on the ground Figure 46 right image and further sitting on the eggs Figure 46 Record of the male bringing a prey The left frame comes from the door camera the right frame from the floor camera Data by the ornithologists In this case frame rates of both records were lower 4 67 fps for the door camera and 2 30 fps for the floor camera The reason is that new recording started almost immediately after the previous one was finished but finished here means the moment when the floor camera stopped recording not when the frames post processing was complete So the cause is the same as in previous cases where it influenced only the floor camera Again it is not ideal situation but better to have a record with lower frame rate then to miss it completely it still provides all needed data The most important information from the data tzt file listed below is the missing RFID code This is typical result of this part of the system while the female is usually scanned properly as it always passes through the RFID antenna the male
13. Apr 16 21 23 55 2014 RFID 3774526282 Temperature internal 25 75 C Temperature external 0 00 C Ambient light 3 The female returned 5 minutes later at 21 28 40 record 20140416 212840 033 The door camera recorded the female passing through the fly in hole Figure 45 left image while the floor camera recorded the owl landing on the box ground and sitting on the eggs Figure 45 right image Figure 45 Record of the female returning to the nest box The left frame comes from the door camera the right frame from the floor camera Data by the ornithologists Frame rate of the door record was 10 fps as expected The floor record frame rate was 3 07 fps for the same reasons that were described above From the data txt file below we can see now both internal and external temper atures fell down The internal temperature dropped by 6 degrees while the external temperature dropped just by 0 25 C First software bug is discovered here as the tem perature is stored in an unsigned char variable so 255 75 C is printed instead of 0 25 C To get the real temperature user needs to subtract value 256 The bug is easy to fix for the next real operation after the expected maintenance The exterior light also dropped from 3 to 2 but it has no real meaning as the sensor is already under exposed and these fluctuations are generally caused by noise The same RFID tag was scanned again 58 6 2 Outdoor Testing Date Wed Apr 16
14. O DiS D14 D15 DIO D11 D12 OQ D7 w DDD BudkaLighting Figure 52 Silkscreen layer top Figure 53 Silkscreen layer bottom 83 Appendix C Printed Circuit Boards C 3 BudkalRBar Routings and silkscreens of the infrared light barrier board named BudkalRBar TOP BudkalRBar V1 1 Figure 54 Board routing layer top 84 C 3 BudkalRBar Figure 55 Board routing layer bottom D17 e TOP BudkalRBar V1 1 X2 T 2 E UUL C1 C4 U2 Figure 56 Silkscreen layer top 85 Appendix C Printed Circuit Boards C 4 BudkaLTS Routings and silkscreens of the temperature and light sensors board named Budka LTS Figure 58 Board routing layer bottom R T11 9 Figure 59 Silkscreen layer top o 86 Appendix D Photographs Photographs of the nest box and its components ar MY n P E S 5 L C5 n 1 E a AS 48 ae da Figure 60 BudkaLighting board with attached camera BudkolRBor X2 Figure 61 BudkalRBar board installed in the nest box Figure 62 BudkaLTS board variant with the light sensor Figure 63 BudkaLTS board closed in a cover Figure 64 RFTD antenna and the PIT chip Figure 65 Installed fly in camera light barrier and RFID antenna Figure 66 BudkaControl board covered in the covering box Figure 67 BudkaControl board installed in
15. PKOLOS 7 pies rele e et de pem en aan photos from appendix D gchematics 2 24 buisse el da ega schematics from appendix B experiments indoor sexes RR ta prey simulation output L outdoor rr XR px e O is real output config EE job CEE o y esee eve vete tee linux side configuration TOP cfg ideas deese Eme log counter internal configuration MN mqx side configuration data 20140414 204103 767 cece cece eee eee first record directory AAA Gina eds sch SERRA er VERUS ee ee record summary GOK avi idc Ue ddd eva e ere BS fly in camera record IE SOO Tog oh R Alia eR ees fly in camera log E LOOMS AV AY aldo ground camera record oO Loa dada kl ent di u tees ground camera log 20140414 212102 468 eese second record directory A reed cotes aue d ue Liegen edat application logs L gensors caiga a lists of sensors readouts 20140414 095131 txt 20140414 100441 txt 20140414 141357 txt dJin x sSdk lee nt e eee el cas SDK generated by Factory bootloader u boot inmX A reine k oe elle Ron eo RI e do RC e fa U Boot binary L kernel source cemin en i a veED Ius complete kernel source files E linux 3 0 BOONE T c sh6 xc RE De USOS E S ens kernel configuration file rfs rootfs tar ELA A ht e IIO D LUN M LS device filesystem image L toolchalin wesc kov zoe t ete papa AEG pk ala build tools libraries etc LLGCORfiE seeren samen ee save eoa en eR RR workorder configuration file uImage 3 0 ts armv
16. TSN NITS OLND4 Dd Eva DD ANIMOS DZ Vt20 oNu tvd OMS BGM ldwDV t d MM OlaMs DAG LLNO OW LAVTAd DMS 980 0100 ONU VOI LE Toy W Aces quawaseld annewary Pi U x AQOT VOO D z3nonun i Za 10H Xu ON1 SHO 030V Sd gr sioun ej ial Xu inm osas Tan i Xd ZSTVEHO Dd DV Ed XL ZSN ZHI Od IwW Dd RRE ST vt TT or y VOS 321 020 OWLL OVd E t an FINGOW WAGOW 3 1 xiinai oso siiuwn OS2d DIAS 305 0145 ANOS Olds NIS Olas lt xeon FB aa PT 4A OSL HNOS DAL M1 WMA VOS 1971 8200 V8 ONDQ LTNODY BZALd Hs 1971 4200 98 ONDG SINGDW LZAla 8za31 58 0rod stNoOM ozld SZOVA Orod vINOOM SZ3l4 2097 9 OrOG E tNODM PZ31 2031 28 0nod ztNOOM EZ3 ld zz03V t8 0rod zzild Tanoa manad SNNANOS 0921 0200 1 40 onoa rtNoos ozaLa DS 0321 610D1 99 ONIGPOTNOJM 6T31d STGITS9_ONSA ENCDW STALa 41GD19 0N20 8NOD4 L T314 91051 9 0N90 LNOY 9T3 1d 5131 29 0N INOOY STA LA PION 0ND0 HT3L ELa31 09 ONDG ELALd v x14Veta3 VESA 1185 08 0NOA SNODY ZTA Ld TADY ONDA PNODY TALd 01097 64 ONDA ENODY OTALa 6031 4 _0N00 ZNOJY 63Ld 8020 4_0n0A TNO3Y 831d 1031 24 0100 0N0D8 2114 9031 14 000 9314 5031 03 OmQ S3ld PODIENODL OMAA ODA ALA ETDIONODL OMA OVL ONI0 E3Ld 2031194 ONDO Zald 1031 2N001_ ONDG DNASA 0N20 000WL008 131d OGDI INODL ONDA ANASH ON20 TGOWLO0B 031d T OND dM TOHOS GHO EWLA OTO jN SOV 84 9203
17. a control interlink application and an MQX application controlling the system logic and peripherals The system has been already delivered to the ornithologists and tested in practice It showed to be fully functional producing quality video records of observed owls and multiple additional types of data A few issues are yet to be tested and solved for example possibly higher power consumption than expected or unimplemented Wi Fi interface which would allow to download the data and control the system remotely without owls disturbance 61 Bibliography 1 Mark ta Zarybnicka N vrh Standardntho projektu Geografick variabilita hn zdn a potravn strategie s ce rousn ho Czech Version Final Registration number 14 097975 Apr 2013 Michigan Bluebird Society Monitoring Nest Boxes Michigan Bluebird Society URL http www michiganbluebirds org monitoring forms visited on 04 02 2014 Costas Grivas et al An audio visual nest monitoring system for the study and manipulation of siblicide in bearded vultures Gypaetus barbatus on the island of Crete Greece English In Journal of Ethology 27 1 2009 pp 105 116 ISSN 0289 0771 DOI 10 1007 s10164 008 0091 2 URL http dx doi org 10 1007 s10164 008 0091 2 Diane Colombelli N grel and Sonia Kleindorfer Video nest monitoring reveals male coloration dependant nest predation and sex differences in prey size delivery in a bird under high sexual selection
18. a record of two video seguences and accompanying data client sends a RECORD message with data triplet interier temperature ex terier temperature exterier light stored in iParam iParam2 iParam3 If the server is ready i e it is in the READY mode and not busy it imme diately replies by ACK with iParam set to MCC OK and starts recording the video In a short time period the client sends a RECORD FINISH message with iParam set to MCC OK and uParam set to detected RFID code or with iParam set to MCC ERROR if no RFID code was detected The server replies after finishing the recording job by ACK with iParam set to either MCC OK or MCC ERROR depending on the operation result If the server is not ready when the RECORD message is received it replies by ACK with iParam set to MCC ERROR and the transaction ends client does not send more messages Table 1 appmgr inter core client server communication protocol The communication is al ways initiated by sending a message of type in the left column from appmgr to appmgr The SET READY operation is more complicated by taking several trials before giving up as the remote operation labelled as A5 SET READY is not fully reliable due to USB issues That is not a pleasant solution but it is acceptable as this operation is not time critical The RECORD event is triggered by disruption of IRBAR handled by the irBar rier task and is only valid when the system is in the READY mod
19. case of failure this direction was not further considered Seeking for a Linux distribution it was evident that a custom one must be built as the kernel configuration and BSP must be adjusted according to the custom board It was logical to choose the LinurLink framework by Timesys Corporation Timesys for a bunch of reasons First Timesys is a trusted source of embedded Linuz 22 with deep experience in real time Linux They develop LinuxLink a software development framework for configuration patching building and maintenance of an open source Linux platform 20 4 2 Software i Comprehensive Freescale Solution Development Tool Customized with MOX Task Aware Application Tasks and nem Debugging Industry Specific Libraries CodeWarrior Development Studio IAR Embedded Workbench ARM Keil MDK GCC Compiler Application Open Source BDM JTAG and Third Party mw e Emulator Probe PC Hosted On Device E Freescale MOX Software Solutions Figure 19 Block diagram of a software solution based on the MQX RTOS From 20 Tt includes a Linux kernel GNU toolchain packages libraries and development tools All Linux platform components and updates are open source and are provided through the LinuxLink Factory custom platform builder 23 see fig 20 for the typical Lin uxLink flow They also provide documentation and support They are a partner of Freescale supplying Linux PSPs for the Fre
20. cases installation boxes ip 55 and more html vyrobek 442 amp jazyk en visited on 04 17 2014 Microchip MCP3221 Low Power 12 Bit A D Converter With I2C Interface Nov 29 2012 URL http ww1 microchip com downloads en DeviceDoc 21732D pdf PerkinElmer Optoelectronics Photoconductive Cell VT800 Series URL http www gme cz img cache doc 520 059 vt83n2 datasheet 1 pdf visited on 04 17 2014 Libor Hofmann HL HF RFID Tags UHF RFID Tags RFID Antennas UHF label UHF RFID antenna Czech Republic URL http rfidtag cz visited on 04 17 2014 Wikipedia GNU toolchain Mar 18 2014 URL http en wikipedia org wiki GNU toolchain visited on 04 17 2014 Elnico s r o EasyBoard Development Kit URL http www sqm4 com easyboard development kit visited on 04 18 2014 Wikipedia Netpbm format Apr 10 2014 URL http en wikipedia org wiki Portable graymap visited on 04 19 2014 Wikipedia JPEG Apr 10 2014 URL http en wikipedia org wiki Jpeg visited on 04 19 2014 libjpeg turbo Project libjpeg turbo About Performance Feb 11 2013 URL http www libjpeg turbo org About Performance visited on 04 19 2014 65 Appendix A DVD Content This thesis is accompanied by a data DVD containing the software resources used and developed in terms of this work Its structure is listed here 67 Appendix A DVD Content 68 DVD appendices e PoBSY A ii PCBs from appendix C P
21. configuring the Linux kernel To run menuconfig for the Linux kernel make kernel menuconfig command line command is used while command make menuconfig is used to run menuconfig on so called Workorder in Timesys terminology i e the Linux distribution configuration Concerning the kernel and workorder configuration there is an official distribu tion available for the TWR VF65GS10 24 Vybrid development board by Freescale in the Factory as already described in Section 4 2 1 Elnico sells a development kit for their SQM4 modules the SQM4 EasyBoard Development Kit EasyBoard 41 derived from the Freescale Tower development platform being highly compatible with that board Elnico provides modification of the official Vybrid distribution with some BSP changes and patches for EasyBoard e g support for two USB Host devices needed for our application BudkaControl board has been developed to have the same BSP as EasyBoard allow ing to use the Elnico modification of the Factory workorder without need to make any changes in the Linux kernel To sum up Linux kernel version 3 0 was used configured and patched for the Vybrid platform Its source files including the configuration file can be found on accompanying DVD in directory linuz sdk kernel source see Appendix A The Factory workorder configuration was reused some changes were made though For example configuration of BusyBox was modified to include tcpsvd and ftpd tools n
22. deer mem Oy Lo th P bun dE ee ne 8 C 2 BudkaLighting 5 2 koe ee R a RR e bns C3 BudkalRBar culo qon Sun wu death Gl Boke a nk CAN Re d wa C4 BudkaLT8 1 uk bok hee Be Ag dny E ad ped mu D Photographs xii 67 71 72 76 TT 78 79 80 82 84 86 87 Abbreviations List of standard and few own acronyms and abbreviations A5 ARM Cortex A5 ACK acknowledge ADC A D converter API Application Programming Interface ASCII American Standard Code for Information Interchange AVI Audio Video Interleave bps bits per second BSP Board Support Package CCD Charge coupled Device CMOS Complementary Metal Oxide Semiconductor DC Direct Current DCT discrete cosine transform DDR Double Data Rate ESL Elnico Support Library FFS Flash File System fps frames per second FTM FlexTimer FTP File Transfer Protocol GCC GNU Compiler Collection GDB GNU Debugger GNU GNU s Not Unix GPIO General Purpose Input Output GPL General Public License HD High Definition HEX hexadecimal HTTP Hypertext Transfer Protocol HW hardware PC Inter Integrated Circuit also IIC or I2C ID identifier IDE integrated development environment IP Ingress Protection Internet Protocol IPC inter process communication IR Infrared IRBAR infrared light barrier JPEG Joint Photographic Experts Group LED Light Emitting Diode LGPL Lesser General Public License M4 ARM Cortex M4 MCC Multi Core Communication library MCFS Multi Core File System MCU Microcontroller Unit m
23. derived from the TWR VF65GS10 BSP and is available from Elnico In ad dition because BudkaControl was designed to be compatible with EasyBoard its BSP was used for the Birdhouse application The MQX applications are built the way that the MQX operating system is first configured for the application and pre built to a set of libraries containing different components of the system These are then linked together with the object files of the ap plication into a single executable file which is then downloaded and run on the device This library distribution is a part of the project and can be found on the accompanying DVD in src birdhouse libmgx directory see Appendix A Similarly to MQX the ESL library is configured and pre built to project specific libraries which are linked together with the application in a single binary The ESL library distribution including the configuration file and binary is located in src bird house libesl directory on the accompanying DVD 5 2 2 Application This section describes some implementation details about the application startup and recording Startup Standard real time embedded application is typically a single binary burned directly into the MCU FLASH memory or another type of a non volatile on chip Read Only Memory ROM which is directly accessed and executed by the processor This is also the case of MQX in general Different approach is taken with Linux though as the linux kernel is too b
24. directory contains video data recorded by the application one directory for each record The directory is named by timestamp of the record i e date and time when it was captured Each directory contains two video files with accompanying log files and one text file with the environment state at the time of recording For more information about the files see Section 5 2 2 The log directory contains application log files from both MQX and Linux side of the system They are unimportant for the user but may contain valuable data for troubleshooting in the case of application failures And finally the sensors directory contains a list of files each created at a new system startup containing periodic sensors readout data The symbolic format of their 49 5 Implementation config linux cfg log cfg mqx cfg data 20140414 204103 767 data txt door avi door log floor avi floor log 20140414 212102 468 _log sensors 20140414 141357 txt eee Figure 40 Example of the public data directory tree lines is following d t tons C trnr C text C 1 v V with the following meaning of the symbols d Date of the readout Time of the readout On board temperature irrelevant for the user tir Temperature inside the nest box Temperature outside the nest box Ambient light outside the nest box v Measured power source voltage
25. event MA FRAME event l Time Figure 32 uEye camera software trigger mode flow diagram From 32 To allow for capturing frames with a requested frame rate new capture cannot be initiated right after the application is ready for it but it needs to wait for a syn chronization message from a periodic timer The timer sends two types of messages first the periodic frame ticks and second the end of capture message to ensure proper capture length When the whole image seguence is complete it needs to be encoded to the video format That is done asynchronously using an external script labelled as postprocessor see Section 5 2 The script is run by appmgr ueyeusbd ueyeusbd is a Linux daemon i e a background process responsible for the system to recognize an attached USB camera and perform all background work needed for its correct operation The program is part of the uEye library mcfsd mcfsd is a Linux daemon playing the role of server in the MCFS subsystem It receives file operation requests from the MQX application via MCC library and performs the op erations on the local file system It is a third party program delivered as a part of ESL library More information at 31 eslAppCtrl eslAppCtrl is the only automatically started MOX application task It comes from the ESL library Its ultimate goal is to start and control run of all application tasks i e realize a software watchdog Currently it only starts al
26. from the floor camera Data by the ornithologists In comparison with indoor testing the records are pretty dark It is caused first by no ambient exterior light and second by much darker scene the real nest box sides are darker in comparison with the testing box and the owl is also dark That can be easily fixed by incrementing cameras gain or exposure in the configuration files The files door log and floor log reveal records frame rates The door record was recorded with 10 fps as expected while the floor record had lower frame rate then configured only 2 57 fps instead of 4 fps This is not caused by the speed of JPEG export but by simultaneous processing of the door record by ffmpeg and recording of the floor record by ueyerecl Since Linux is not a real time operating system it is complicated to ensure the reguested frame rate Even though it provides a priority mechanism which was used the priorities are not absolute processes with higher priorities are just given more processor time then others but the other processes also get 57 6 Experiments some leading to the observed behaviour It is not an ideal situation but on the other hand the problem is not critical at least not for this application From the file data tzt listed below we can see the internal temperature was 25 75 C the sensor was placed amongst the eggs while outside it was 0 C and complete dark The RFID tag was scanned properly Date Wed
27. vrhov ho i u ivatelsk ho pohledu oR Ww Seznam odborn literatury Doda vedouc pr ce Vedouc diplomov pr ce Ing Pavel Krsek Ph D Platnost zad n do konce zimn ho semestru 2014 2015 L S doc Dr Ing Jan Kybic prof Ing Pavel Ripka CSc vedouc katedry d kan V Praze dne 20 8 2013 Czech Technical University in Prague Faculty of Electrical Engineering Department of Cybernetics DIPLOMA THESIS ASSIGNMENT Student Bc Petr Kubiz k Study programme Open Informatics Specialisation Computer Vision and Image Processing Title of Diploma Thesis Embedded Computer Including Software for the Intelligent Bird 0 A Nesting Box Guidelines Follow your own research project A4M33SVP which you solved in the past semester and which introduced you into the topic Design and implement data collection system with the processor Freescale Vybrid VF6 which will be the core of the intelligent bird nesting box connect necessary peripherals to it two cameras two illuminants light curtain RFID reader WiFi module and potentially a remote control Design and implement system sw for the intelligent bird nesting box based on operating systems MAX and Linux Design and implement the application sw of the intelligent bird nesting box Collaborate with ornitlogists from the Czech University of Life Science Prague in embedding the computer into the nesting box and take into account their use
28. with a circular antenna positioned around the fly in hole used to identify owls fitted with a PIT tag The entire system illustrated in Figure 3 was powered by a 60 Ah 12 V traction battery which sufficed for 6 8 days operation 4 Design The event based surveillance system from 5 described in Section 3 3 became a good model for the new system being developed The reguirements posed on both systems were practically the same so the actual task was to redesign the system from 5 using the up to date technologies allowing for more functionalities and better performance 4 1 Hardware The conceptual design of the system depicted in Figure 4 is very similar to the design of the model system shown in Figure 3 The main difference is in the number of cam eras which is two instead of one Also illuminants are controlled directly by the cam eras Important change not visible from the figure is that the image data is stored in a centralized data storage on the control board so the amount of data is not limited by the size of cameras internal memories as it was in case of 5 Lighting Lighting User Interface Camera Camera RFID Reader ontrol Board Interior Sensors Light Barrier Battery Exterior Sensors Figure 4 Conceptual design of the system hardware The arrows symbolize the direction of communication control Completely new items to the sche
29. 0x3 000000 starts the M4 core by enabling its clock and instructs it to execute the program from its start address 0x3 000401 The bi nary file is the MOX application built by the IAR toolchain the addresses come from the linker configuration After all these steps performed both cores are running their applications which initialize all needed peripherals establish inter core communication and start doing their job as designed in Section 4 2 3 Recording When the application is in the READY mode and the infrared light barrier is disrupted the recording operation is triggered immediately Just to recall the recording trigger is a long sequence of communication operations as illustrated in Figure 38 The light barrier disruption changes the IRDETECT GPIO input see schematics in Appendix B 3 which triggers a hardware interrupt handled by the rBarrier task This task sets an event to the appmgr task which sends an MCC message to the appmgr process and that sends two IPC messages to the ueyerecP process Its IPC interface translates the message into an internal message type sent to the main message queue dd utility was used for this purpose More in README txt and install sh in sdcard directory on the DVD see Appendix A 46 5 2 Software running in a different thread from where the camera recording process is finally started See Section 4 2 3 for detailed communication description Figure 38 Recordin
30. 1 Control Board 5 1 2 Camera and Lighting 5 1 3 Light Barrier 5 1 4 Temperature and Light Sensors NOD ool 10 11 13 14 15 16 16 17 17 19 20 22 22 22 23 24 24 34 35 35 35 35 36 36 36 36 36 36 37 39 39 39 41 42 42 xi 53L5 REID Reader um A ooo ux p pli vo Rs 5 1 6 Cover Tamper Button lt lt lt lt lt lt lt lt a D2 Softwaren z on mono E OE OX Rok o4 Roe Rex kval Roe n Bo 5 2 1 Toolchab go E A Ra i a x e des UX sque 3 RA AR CRY eR ROL e baise wA te ies MOI e mand dit ier DL da oz E e la limits S 5 222 Application en 4 84 Pe e e ta Det Startup 2 4 ee a Rem a is OR a Recording arise nu uw Als awl o AA Adi a Jas 5 2 9 Usage 2 ara e Po ee e Boe Sd ad Application Data c 4 2 x oO a RR doE Eo Application Configuration lt lt lt 4 44 System Configuration 2 22A 6 Experiments 6 L Indoor Testing i sux RA a dy eko AE Ek A a RES A 6 1 1 Power Consumption en 60 L2 Prey Simulation saeu mite 8 818 o Roo ae BUR o Red 6 2 Outdoor Testing lt lt lt lt lt ee T Conclusion Bibliography Appendices A DVD Content B Schematics B 1 BudkaControl 223 a simo nome hg eedem RR E mou B 2 BudkaLighting 0 00000 000 eee ee ee B 3 BudkalRB r eones Be Oe wee a eS Bred BudkaL TS E acu See wl Be vk ee RG RU asta C Printed Circuit Boards CT Budka onttoll ee se
31. 3joA 9U 1 4J 1 J9M01 VGA WO4 paja3I 4 NOW 247 uo JAY 104 oBejjon aduaJajal Jaddn NOW ENEd Wo pajey 14 s3In21p Gojeue pue NOW 104 Jemod VGA Wow Jeus N3 SYLA 243 Aq pajjoj3uoo uiis Jamod ASN yo andino SIMD uonejsuen ebe3Jo WaESO Aq pesn now CIWS ayy Wo jeu6is NA AS 9u1 Aq pej o13uo UDJIMS samod ASN Jo 3ndino U23IMS Jamod gSN 03 3ndu 403 euuoo gs Woy paJe3 IJ JBMOd 3ndui Aepuoaas Up3IMS Jamod gSN 03 3ndu uewod jndu Jeu lid AE E WO paH Jamod eibip NOW punoj5 jeuibiq GND Wo4 pao SYND Gojeue pue NOIA 104 JaMOd vSSA Del d 6 6 id esr our AS a NERO REO O9 Sui NOLLdI4DS30 SIN PUNOIO S JaMOd WS E AS AZT AlddNS YAMOd DN IHOLIMS 3eeus z 3eeus 193113 WAGA WSSA TWIX ZHM 89L ZE TVIX ZHAPZ DSO ZHW 0S 31ndOW 94A HNOS O5fn83ad ce amp csd G3A udasau Iuvn 13NY3H13 3eeus 18998 unde ANY T VYAWV3 LSOH asn uaavau 0148 vn SYOSNAS 3univuadWaL jesus 3eeus 3eeus 219 ANY HATIOH ANALIVA STOH LIN 3eeus Z 4894S 193130 Y4dWYL IOuLNOO ANY DN LLS3L INO VNHSINV 3eeus ICH Z 3eeus xw IYN Guv2 OYDIN QS ERED sd WOLO3NNOO NO ISNVdX3 3eeus 39eus JINON W3GONW 3 1M Z 3eeus YOSNAS ualduva 1H9TI IVHA EELNOA NIOSHA 3eeus 199113 TAHMA HAASA 0 AO AO AEE AEE AEE AEE AS AS AS AS ADVLOA CNO VSS HIYA H33UA vada NOW EAEd NE E 8sn DYL ASd MS ASd 8
32. 7l 00 Linux kernel binary see the next page DVD L src L thesi README txt L install sh appmgr birdhouse iar m continued from the previous page sdcard rfs overlay etc init d S60 ftpd 960 vsftpd 992 usb S94 ueyerec S99 birdhouse fstab L root app config linux cfg mqx cfg data 1og sensors appmgr iLLbirdhouse sqm4vf6 eb m4 bin f MOH SAL ia a ueyerec video_encode_tmp sh libesl libmax m ueyerec s pdf additional RFS data system init scripts application data directory appmgr binary MQX application binary MCFS daemon binary A aa des ueyerec binary postprocessor script SD card preparation comments SD card installation script appmgr source files MQX application source files IAR project files ESL library distribution MQX library distribution ueyerec source files electronic version of this document 69 Appendix B Schematics Schematics of all custom boards developed by Elnico s r o 71 Appendix B Schematics B 1 BudkaControl Schematics of the control board named BudkaControl WIFI MODEM MODULE and external RTC are not placed 72 1 BudkaControl TOULNOD WINE HNOS ODINTZ TOZ 8 plug aua E E E T Ww4ov Id 19079 sed Rj noze oo VSSA UJ0JJ paJa3IlJ NOW 247 uo JAY 104 ebe
33. A Is 000 20 DWeL 8 Tv Ld lt SN 0E01 135 toqv 20 O8Sn TO3ovuL LTV 14 51 035 TDGV NA STRA OBSD OC3DVWL STVLd ANO W3dWV ONM DG amp W3dWVL DA NI BANY ONM DG 2dadwvL DA DEdHVL 1x3 OBAN DA e ZAY 84 09 E1dS SO0 8 OIdsO ETQld QV 84 1NOS E IdS 0V1VO 8 014S0 2Ta14 POV 84 NIS ldS LV1VQ 8 014SO TTALA lt Da Sdv 82 0594 ElWS 2V1VO 8 DIASO OTALA av 84 1005 11dS 2DS 8 014SD L01d Qv 84 NIS TIAS 500 V 01450 9014 otav 84 0534 TIds oviva V O149D sad lt 3104S SIOV 84 XL ZDSADS V 014S0 001d lt NINLEQIN NIXI EIS TDdV EHO OWLS SIVS 9EGD1 23S T3GV ZHO OWLA TENOO4 Z81d lt IWS SEQO1 E3S 03GV THD OW3 0ENO24 T81d ZS ECOVUDADVAL ZAS 03X 0H2 OWL3 081d T Kroer 000 roer asan Obten Oo ooova L2 reet oz oi DD net 6x eroi L2 traer Com L gt Kor ver sodes L gt lt eet NIS ZIdS DS ewer 4nos zs DO cer os als gt over Sef ast goi L voel eof IM AEER So zoel IOUN K vest HOLOSNNOO NOISNVdXH 9 xax TZ VS ZOAS wsa odxu 1 vani l vam E sx XL xL l He v x dv lt IWS3 2504 OMS FDTAL OIQN 01W4 D14 gg l lt S WWS3 ESDA OIdS OHOUWI4 CIN 01 0214 79 Sd 2a VN 59 Wa zesrve ON l Shan ten pe Onst dd resn 9 4d asa olo wo tesn E Na taen 515 san oon Fr nse do 4a ossn 0 hd omn ee NG 050 gig ino pssawa issu ge GRESS NuvaA T8 NIIS 2 2 Z_EEQGA E pac TEEGGA o I w E ASd ENSA Tasa fee Ons END Te awo i EE Tow I v I TSA Z d5 0HD EW
34. Camera 1 1 J19 2 Camera 1 1 1 J19 1 Camera USB J9 2 Camera J9 1 Camera 0 I2C D J7 2 Camera 0 PCIE J7 1 Camera 0 GPIO2 J1 2 Camera 0 GPIO1 J1 1 Camera 0 J11 2 Camera 0 J11 1 Camera 0 J10 2 Camera 0 USB J10 1 Camera 0 USB J16 2 Light Barrier J16 1 Light Barrier J21 2 Light Barrier GND TRIGGER J21 1 Light Barrier IRDETECT J27 2 Sensors Internal J27 1 Sensors Internal GND J26 2 Sensors Internal I2C D J26 1 Sensors Internal J29 2 Sensors External J29 1 Sensors External eh J17 2 Sensors External I2C D J17 1 Sensors External Table 3 Terminal strip peripherals and cables assignments The left column background colours correspond to peripheral colour markings on the terminal strip Background colours of individual cells in the Function column correspond to colours of respective cables Signals in gray italics are not used The board basically expands all needed peripherals of the SQM4 VF6 W module which is mounted in the center of the board 1 The ELB149C5M RFID reader module 2 is located over the base board which it is fixed to using spacers Under the RFID module there is placed a MicroSD card slot 3 and a 3V battery needed for powering the on chip Real time Clock RTC peripheral when the power source is detached Next to the RFID reader RJ45 Ethernet connector is placed 5 For connecting all the peripheral boards terminal strip 3 is used Cable assignments accordin
35. Eye LINUX URL http www ids imaging de frontend files support uEye LINUX visited on 08 2013 IDS Imaging Development System GmbH Downloads URL http en ids imaging com downloads html visited on 04 10 2014 Freescale Semiconductor Inc MultiCore Communication Library User Guide Version 1 2 2014 URL http cache freescale com files 32bit doc user_guide MQX_MCC_User_Guide pdf Elnico s r o ESL Elnico Support Library URL http www sqm4 com esl elnico support library visited on 04 11 2014 IDS Imaging Development System GmbH uEye Camera Manual Version 3 90 2011 Chap Camera basics gt Operating modes gt Trigger mode URL http en ids imaging com downloads html RTX A S RTX4100 Wi Fi Module Version 2 4 Nov 21 2013 URL http www rtx dk Files Billeder RTX_T RTX411 20Documentation RTX4100 Datasheet_DS1 pdf Enika cz s r o 61 2140002 ELBOX 17127121255 transp URL http www enika cz en electromechanical components boxes and cases installation boxes ip 55 and more html vyrobek 448 amp jazyk en visited on 04 17 2014 IDS Imaging Development System GmbH uEye Camera Manual Version 3 90 2011 Chap Specifications gt Electrical specifications gt USB uEye LE gt USB uEye LE pin assignment I O connector URL http en ids imaging com downloads html Enika cz s r o 61 2090002 ELBOX 115165140 transp URL http www enika cz en electromechanical components boxes and
36. Handling Vo Kernel Subsystems Logs Log ee As Needed Figure 18 Freescale MQX MQX real time operating system RTOS highly customizable microkernel architecture From 20 Besides the kernel MQX contains also Processor Support Packages PSPs for all supported platforms Board Support Packages BSPs for various development boards optional software stacks services and frameworks see fig 19 e FFS Flash File System low level flash drivers with wear levelling e MCC Multi Core Communication library efficient inter core MQX to MQX or MQX to Linux communication subsystem MFS Embedded MS DOS File System RTCS Real Time Communication Stack a TCP IP stack implementation Shell A lightweight command line environment USB Universal Serial Bus host device stack MQX further contains tens of examples and a pretty quality documentation To gether with referential development kits and quite good support MQX became the best choice of all available operating systems runnable on the M4 core Also availability of Multi Core Communication library MCC and Elnico Support Library ESL is a great advantage as described in Section 4 2 2 Timesys Linux OS Linux is not a real time operating system by design There are some Linux kernel modifications or extensions for example PREEMPT RT 21 but I have no experiences with these extensions Since the application belongs to the soft real time category with no critical impacts in
37. IJ STO IN IEQV 84 TE0LA 20 Tasn 0524 MS TO EWLAPTO I 3N OEQV 84 0EQ LA Sod vds I NIS ZBS 2HD ENLJ ETO 1 3N 620V 84 6204 NIS uS tHO ENLA DS COZUETOI AN 8ZAV 83 8014 1nos zias lt PHO EWA OS 292 TLOI AN LZGY 84 12014 308 zs l SHO EN14 60 AN SZAV 83 504 30 085n LHD EWL 80 IN VZOV 84 7014 RES l irpd sxs TDGV DNAS XL TIVS 62NOJ4 TEDLd LO lt 84 59d_T IdSONJS XM TIVS ZNOJ4 0E31d 970149 l lt BA SDd QS NLVA XL LIVSILENODN GOLd 5 oleo lt INDU A MY 83DNAS XI OIVS EZNOD4 8781d Ems l lt 8y S1D TDS VLVO XL OIVS L2NOOU 9Z81d ZMS lt SL G4 83 XL_1OSANOS XL OWS EZAL4 s I Qi nIWGJTNPDS OWS Zeald OS Qs nos ols NIS 0195 219 nara S9 ES olo vas Dei DS II a 1 El vas oxi A A DS VIZI ols NO WOSN3S I Xu oDuivn Xi onn ED an I 0340311 sip Livn I SL tav X in I XL twn REN fe paisa lt TINODL TNOG N PAD HNWLNOD Iva T SINpow 94A PNOS 74 B 1 BudkaControl
38. Master s thesis Embedded Computer Including Software for the Intelligent Bird Nesting Box Bc Petr Kubiz k 2014 Ing Pavel Krsek Ph D diploma thesis advisor Czech Technical University in Prague Faculty of Electrical Engineering Department of Cybernetics Acknowledgement I would like to thank all people who helped me in any way with this work Especially my girlfriend for all her love and everyday care My family for overall support Mem bers of this project for great cooperation and supervision Elnico s r o for providing development tools and exhaustive technical support All business partners who helped with components selection or otherwise participated And last but not least all de velopers of free and open source software without which this work would never come true Declaration I declare that I worked out the presented thesis independently and I guoted all used sources of information in accord with Methodical instructions about ethical principles for writing academic thesis Prague Wednesday 7 May 2014 0 2seseseeseseseseeeme eene ii Abstrakt Tato diplomov pr ce popisuje n vrh a implementaci autonomn ho kamerov ho sys t mu vestav n ho do pta budky Tento syst m je po adov n t mem ornitolog pro v zkum s ce rousn ho v jeho p irozen m ivotn m prost ed Nejprve je navr ena se stava hardwarov v bavy kter je n sledn vyvinuta a vyrobena firmou Elnico s r o dle
39. O n em zo ay wa tasn ro mm Cia enon oR ZONY I VYJAVO 1SOH asn Om i pod 1 20 t8sn SWIOH HIWLNON l os O ex Ox ead ud Ea ZOHAN ZNOHIN Ll Qni pol E I i sl T Deen o z ootHosooaooszza mel ane a ca WA lt enn tersa e ipe lt vas 0021 9 or ET Dy Ds wz bi o3uo3wl bd s Ve J i zoe A En Gezo9s18d i zam xH aor poc os o an9 tol 2 bd Sermon ME ted a wl EE d eum vos zu ASK cf AE s m sazan id BL MS he MISS EE i Tul aa i Ha a ap lane DEbava NE ozzy ANAL i OMT 8zu jal Zz OREIRO Mur Dd To ned T n i ON ves a Wdavdu GI4d LYvn WEM P A EE gt Je i a ozy zin i I AE V o o A nn Pam OZZT YD i a QuvoSNO NAD TYNYALNI DIN ONY UXTIOH AYALA HOSNAS uinduva HON 9 RR 2 E A osrmoscoacoseve B ues de O AAA ANA S S O RAN OR EN K O y ER ow C E E NU ce Pd NI 1S3L 2 ES i Tar wel wil ano e F T eo 5 x E E i i mez ana EAE SBXZI a bd zoe E a c PES aru E 604 us Ty Teo i WIE de ae i o E sb Busty peu gt mun a n i woe ae Cowon id sl i Ayauya Sor zav zea T a m ENS j Sus vas oxi zat 2 i Y 3 i m Bosje Ds 002 m SA rat i 6 i n F or Jine A bd sn wa E noze UNAS i T or sea i Te P azzossiad pot ag N T 6EY aa CISDIOEAZ v carl ings E wu s i
40. RADOxX2 mee wRebRDACA2 Timers PAN FlexTimer 8 ch FlexTimer 2 ch FlexTimer 2 ch FlexTimer 8 ch IEEE 1588 Timers Ao si Figure 5 Freescale Vybrid VF6xx microprocessor block diagram From 9 The speciality of the microprocessor is its asymmetrical dual core architecture con sisting of one 500 MHz ARM Cortex A5 A5 core designated for running a high level operating system OS and one 167 MHz ARM Cortex M4 M4 core primar ily for low level hardware operations The ARM ARM architecture is a guarantee for low power consumption and well designed hardware The microprocessor is new available generally since January 2014 promising a long time support And finally there exists a processor module SQM4 VF6 W assembled with this MCU It is manu factured by a Czech company Elnico s r o Elnico commercially available from 10 10 4 1 Hardware SOM4 VF6 W is a product from the SQM49 SQMA4 solderable processor modules series Every device from this series is characterized as a System on Module SOM comprising a microcontroller microprocessor with Double Data Rate DDR mem ory NAND FLASH memory Ethernet and Universal Serial Bus USB controllers on a squared module 16 cm interfaced by so called RIM connection with 160 pins The RIM connection provides 4 variants of assembly where one of them Down pins is detachable designed mainly for development purposes while the others are sold
41. The photo of the board with highlighted board items is shown in Figure 34 X1 Figure 34 Realization of the BudkaLighting board with highlighted board items description in the text Dashed lines mark components placed from the other side The board implements the IR flash as five parallel sets of three TSHG5510 IR LEDs areas highlighted by yellow rectangles There is also one additional red LED used for testing purposes it can be easily turned off by removing the jumper red area The camera blue area is placed on the other side of the board connected by its I O connector see 35 directly facing the board s connector green area and fixed on spacers The USB and USB signals are not present in the camera I O connector but there is an additional USB connector used for that purpose The camera is connected only to the BudkaLighting board which is connected to the BudkaControl board by a USB cable attached to the terminal strip placed on the bottom side of the BudkaLighting board violet area Hence only USB USB GND and 5V are used being connected to the corresponding signals on the Bud kaControl board by cables coloured as in Table 3 Remaining signals are not used The lighting is controlled automatically by the camera if configured appropriately Dimensions of the board together with the camera are designed to fit in the ELBOX 115165140 transp installation box with protection IP65 36 by Enika Photogr
42. al task is to record an owl adult while bringing the prey into the nest bor and determine the prey species The male owl quickly approaches the nest box opening and in most cases only throws the prey inside The secondary task is to monitor a nesting area on the bottom of the nest box to gain additional information on prey determination prey decapitation and owl behaviour e g sibling competition This means the system has to contain two cam eras the first recording the fly in hole and the second recording the nest box ground Since the owls are active at night a lighting has to be used to provide the cameras suf ficiency of light To prevent disturbance of the birds source of light invisible to them shall be used To allow for identification of adult owls each of them is fitted with a Passive In tegrated Transponder PIT tag of type EM4200 readable by any compatible RFID reader The tag should be scanned each time an owl approaches the fly in hole not de pending on whether it enters or exits the nest box or just brings a prey On the other hand the reader should not scan codes of birds present inside the box To improve the background of the scientific research the system should be able to regularly measure temperature inside the nest and outside the nest box and exterior light conditions The system shall provide an easily accessible interface allowing to access the produced data and configure the main application settings Prefera
43. aphs of the board covered and installed in the nest box can be found in Appendix D 41 5 Implementation 5 1 3 Light Barrier The BudkalRBar board was realized as a simple two layer PCB of the mirrored U shape Its schematics is presented in Appendix B 3 routings and silkscreens in Ap pendix C 3 Photo of the board with illustrated light beam and its direction is shown in Figure 35 Realistic photograph can be found in Appendix D BudkalRBor X2 Figure 35 Realization of the BudkalRBar board with highlighted light beam and its direction The board is connected to the BudkaControl board by a standard four wire cable with individual wires coloured according to the colour scheme in Table 3 The Bud kalR Bar board is not covered in any box it is meant to be fixed directly in a groove in the wood by two screws and covered by a wooden and metal plate The whole board is varnished for better endurance against the weather conditions 5 1 4 Temperature and Light Sensors The BudkaLTS board was realized as a tiny PCB common for both variants with and without the light sensor See its schematics in Appendix B 4 routings and silkscreens in Appendix C 4 The illustration photo of the variant with light sensor with labelled assembled parts is depicted in Figure 36 gt dus EJ t ce ci Thu E Figure 36 Realization of the BudkaLTS board variant with the light sensor 1 Temperature sensor MCP9804 2 A D conv
44. ble solution would be a wire less communication on standard TCP IP protocols The easily accessible RJ45 socket with the Ethernet connection might be used as a fall back variant for case of the Wi Fi failure or if the system needs to be mounted before the wireless functionality is imple mented The output of the system will be 1 Short video sequences few seconds long high frame rates of the nest box fly in hole triggered by the prey delivery events 2 Longer video sequences few minutes long low frame rates of the nest box ground triggered by the prey delivery events 3 RFID codes of the adults delivering the prey triggered by the prey delivery events 4 The list of temperatures and ambient light measurements triggered periodically 5 All data will be marked with a time stamp giving time of its retrieval The minimal configurable options will be 1 Video records lengths adjustable separately for both cameras 2 Video records frame rates adjustable separately for both cameras 3 Camera exposures adjustable separately for both cameras 2 Task Formulation The system will be powered by a traction 12 V battery which will be replaced regularly approximately once in a week Ideal capacity is between 50 and 60 Ah as the dimensions and weight of the battery grow significantly with the capacity a bigger battery is hence inadvisable The system should be designed with respect to minimum power consumption The system wi
45. d processor modules It is a modular highly configurable multiplatform library simplify ing use of often used functionalities and enabling guick composition of new applications from the library modules as follows e appctrl application control mechanisms cfg config files parser and writer crc cyclic redundancy check fs useful filesystem functions gpio GPIO interrupts demultiplexer idc I2C communication log logging task mcfs virtual multicore filesystem nand NAND flash file system rtc real time controller sd SD card spi SPI bus control spimem SPI memory control wifi Atheros wifi control 31 Use of the library can significantly simplify and accelerate the target application development reducing the application code size as Figure 21 illustrates Most of the library modules are used in this project namely appctrl cfg gpio i2c log mcfs rtc and wifi appctrl is a simple module implementing task eslAppCtrl Its purpose is to start all the other application tasks and control their run In the version used in the Birdhouse application 1 004 not publicly available at the time of writing this document its function is limited to simply starting all the other tasks in a defined order cfg is an implementation of a very simple configuration files processor Configuration files are needed to keep the user settings e g camera exposure times gpio realizes a simple inte
46. d passing through the fly in hole the bird identification and environment conditions data Re sults of the first experiments after deployment in the forest in nesting season of spring 2014 are presented Keywords Camera Monitoring Owls Embedded Data acquisition esk vysok u en technick v Praze Fakulta elektrotechnick Katedra kybernetiky ZAD N DIPLOMOV PR CE Student Bc Petr Kubiz k Studijn program Otev en informatika magistersk Obor Po ta ov vid n a digit ln obraz N zev t matu Vestavn po ta a jeho programov vybaven pro inteligentn pta budku Pokyny pro vypracov n 1 Nava te na v zkumn projekt A4M33SVP kter jste e il v minul m semestru v n m jste se s t matem sezn mil 2 Navrhn te a vytvo te syst m pro sb r dat s procesorem Freescale Vybrid VF6 kter bude z kladem inteligentn pta budky a p ipojte k n mu pot ebn periferie dv kamery dva osv tlova e sv teln z vora te ka RFID WiFi modul a p padn d lkov ovl d n Navrhn te a vytvo te syst mov software pro budku nad opera n mi syst my MAX a Linux Navrhn te a vytvo te aplika n software inteligentn pta budky Spolupracujte s ornitology z esk zem d lsk univerzity v Praze p i vestav n po ta e do budky a respektujte jejich u ivatelsk po adavky p i v voji po ta e budky 6 V sledky zdokumentujte z n
47. e Delete the content of directories data log and sensors Abolish FTP connection Replace the battery Establish FTP connection Check the system is on new file created in sensors directory Abolish FTP connection Detach Ethernet cable OONDPAN a ja Rh Application Configuration The application is parametrized by two user configuration files l nux cfg and mgz cfg stored in the config directory accessible using FTP mqr cfg configures the MOX side of the application i e the main application control while linuzx cfg configures the Linux side which reduces only to the main cameras configuration settings Both files have different syntax and are described below The default content of the mqz cfg file is as follows tlwc g config file sleep_enable 1 Sleep hour 7 sleep minute 00 wakeup hour 19 wakeup minute 00 battery low 12000 battery verylow 11850 battery critical 11750 The first line is a comment and can be ignored Each of the remaining lines con tains one record of the form key value User can modify the values according to the description in Table 4 Please note that battery verylow and battery critical should better be set to lower values as the battery voltage measurement does not per form accurately Also note that halting the system is a controlled operation with all files being saved properly while turning off the system is a hard system power down
48. e The operation has two steps as shown in Figure 26 First appmgr is notified about the event so the camera recording starts appmgr replies immediately so appmgr can continue operation It waits for a predefined delay and then retrieves last scanned RFID code from the elb149c5m task Depending on the age of the code as every code is equipped with a timestamp it is used or thrown away Then a RECORD FINISH message is sent to appmgr and execution stops until a reply is received It is responsibility of appmgr to store all the records to the permanent storage appmgr is the main process on the Linux side of the application It firstly starts the mcfsd process needed for the MCFS file system and then it enters the infinite message loop as depicted on a flowchart in Figure 27 It is an interlink between MOX appmgr and the recording processes instances of ueyerec It plays a role of a server in the MCC communication with appmgr and a client in the inter process communication IPC with ueyerec 26 4 2 Software CO gt Initialization v Service WDOG SET SLEEP WAKEUP event SET_READY RECORD event RECORD No Figure 23 appmgr task flowchart SET SLEEP SET READY and RECORD operations are depicted in Figures 24 25 and 26 The infinite loop realizes the server role for appmgr When a message is received appmgr executes appropriate operation
49. e second constraint is a limited number of human resources in scientific research as periodic checks of a scientifically sufficient number of nests may pose high reguire ments on time resources Some researches or programmes try to solve this problem by popularization of the topic and gaining volunteers which collect the data for them This is for example case of the Michigan Bluebird Society trying to help and monitor the population of the Eastern Bluebird Through a large community of so called land lords see Fig 1 they manage to improve the nesting success of the Eastern Bluebird and other native cavity nesting birds in the state of Michigan 2 USA Figure 1 Landlord performing regular check of a nest box From 2 3 State of the Art 3 2 Continuous Recording A widely used technique is an autonomous video surveillance system equipped with a camera a power supply and a data storage or stream Such systems usually record one video sequence continuously typically with a very low frame rate time lapse video or record shorter video sequences periodically with time delays These systems pose high requirements on the power supply and require either a large data storage and its periodical replacement or a sufficient bandwidth of a wired wire less connection allowing for streaming or downloading the data remotely One of dis advantages is a high percentage of useless data when there is nothing happening inside the nest on
50. eady mode besides the periodical sensors read outs recording operation can be triggered by a disruption of the light barrier When that happens firstly a short video sequence is recorded by the fly in camera further referred to as the door camera D then a longer sequence is recorded by the ground camera further referred to as the floor camera F RFID identification is performed in parallel with the camera recording A real design of the application is much more complex though and is discussed on multiple levels operating systems libraries and processes tasks Its hierarchy is depicted in Figure 17 4 2 1 Operating Systems There is a wide selection of operating systems used in embedded Most of them are real time operating systems i e operating systems meeting real time requirements Such systems guarantee the response within strict time constraints often referred to 17 4 Design Power On Boot No Sleep Ready Barrier disrupted Readout scheduled Read out sensors J Record D Identify J Record F Figure 16 General application flowchart The blue blocks are executed by the M4 core the red blocks by the A5 core as deadlines Depending on the consequences of missing the deadline real time systems are divided into three groups e Hard Missing a deadline is a total system failure e Firm Infrequent deadline misses are t
51. eeded to run a minimal FTP server for the remote data access over Ethernet TA minimum bash like processor It is an all in one application implementing hundreds of stripped down versions of standard command line utilities optimized for embedded environments 44 5 2 Software Some libraries had to be added to the toolchain too for example libconfig configura tion files handling library or of course libueye UI cameras API The full workorder configuration is stored in the linux sdk config configuration file see Appendix A MQX While all the development of the Linux side of the application was done under Linux host operating system all MQX development was done under Microsoft Windows OS Windows IAR Embedded Workbench toolchain by IAR Systems was used It is a tool suite for C C development for 8 16 and 32 bit MCUs including C C compiler assembler linker and debugger optimized for embedded applications includ ing RTOS plug ins built in an integrated development environment IDE JTAG in terface connected through the j Trace debug probe by Segger was used for debugging All these expensive professional tools which provide powerful embedded development instruments and produce high quality outputs were made available by Elnico The story about the MQX BSP is similar to the one of Linux The TWR VF65GS10 BSP is an official part of MQX distributed together with it in one archive EasyBoard BSP was
52. eived from appmgrM The example content of the data tat file shows the following listing Date Mon Apr 14 21 21 02 2014 RFID 3774526282 Temperature internal 22 75 C Temperature external 0 75 C Ambient light 4 All these five files door avi door log floor avi floor log data txt are stored to the SD card file system together in one directory named after a timestamp of the record ing start e g 20140414 204103 767 for April 14 2014 8 41 pm which is placed in root app data directory accessible as data using FTP The recorded data flow is illustrated in Figure 39 5 2 3 Usage The last section of this chapter describes the application from the user s point of view and can be viewed as a simple user manual or guideline Application Data This application is an autonomous system with no remote access control mechanisms The system starts automatically when a power supply is attached and stops normally only when the power supply is too low or detached When the system boots it loads its configuration files and starts its automatic operation It collects video and textual data and stores them to a file system The data is accessible via the FTP service Through FTP the user has access only to the public part of the file system where the data is stored An example of the public directory tree is listed in Figure 40 The config directory contains application configuration files These will be discussed later The data
53. eo record duration lt 0 1 300 0 gt s The sum of both durations must be smaller then 300 s duration 60 0 ys The file contains two groups dcam for the door camera configuration and fcam for the floor camera configuration Both groups contain the same configuration records of the form key value with each being commented preceding line s begin ning with the 4 character Please note that it is preferable to increase gain rather than exposure to accomplish brighter records as the longer exposure time decreases the maximum frame rate Remember that the sum of durations of both cameras has to be smaller then 300 and that the temporary output buffer has a limited capacity so the weighted sum of products of framerate x duration must not be too high see Section 5 2 2 for explanation and computation of maximum allowable values When the configuration is being changed the system must be reset afterwards as the configuration files are read only during system startup described in Section 5 2 2 It is also recommended to wait for five minutes before the system is reset so all the changes are flushed from the file system buffer to the hardware medium System Configuration Much more powerful configuration and administration options are available through a direct access to the Linux operating system That includes for example the date and time configuration network configuration or password changes but also updates of the a
54. eographical variation in breeding and foraging strategy of the Tengmalm s owl Aegolius funereus The Department of Cybernetics of the Czech Technical University in Prague Faculty of Electrical Engineering cooperates at the activity I was asked to help the effort in my diploma project by developing and constructing an autonomous computer system My motivation to participate in this project was based on my interest in practical tasks I also have the advantage that my father owns company Elnico s r o which develops and produces embedded electronics Hence I have access to hi tech embedded technologies needed for this project My work contributes to a new type of a computerized nest box enabling the data acquisition and monitoring of owls nesting in nest boxes located in their natural en vironment The nest box is hung usually on a tall tree in the forest It has an own battery allowing its autonomous operation The project reguires a video surveillance system embedded in every nest box to record a fly in of an owl typically a male bringing the prey usually a small mammal Microtus vole or Apodemus mouse or a bird The data needed for identification of individual owls and the type of food supply are recorded Such a system has been developed and is described in this thesis Monitored owls are eguipped by Radio Freguency Identification RFID chips The owl identification has been based on RFID technology To identify the type of the prey the ex
55. er able providing a robust and reliable connection between the module and a base board The SQM4 VF6 W module depicted in Figure 6 is comprised of a 256 MB DDR3 SDRAM memory 256 MB FLASH memory Dual Ethernet USB and also an extra low power WiFi modem fulfilling the request on a wireless communication interface 3 r l KATE eces par alas FeCsCaeetssecsecuvsece Figure 6 Photo of the SQM4 VF6 W module the brain of the intelligent nest box surveillance system From 10 Using the SQM4 VF6 W module the development of the custom base board named BudkaControl became much simpler and hence cheaper task than it would be without it as it reduced to a simple expansion board of the SOM The peripheral scheme of the base board illustrating the structure and assignments of the board peripherals to the peripheral devices is depicted in Figure 7 The peripheral devices are described in the following subsections 4 1 2 Cameras The most attention in selection of peripheral devices was paid to the digital cameras being the most important and expensive part of the system It was decided to buy two monochrome industrial cameras Ul 1541LE by IDS Imaging Development System GmbH IDS depicted in Figure 8 This type has the following features Monochromatic CMOS sensor 1 2 resolution 1280x1024 px maximum 25 fps USB 2 0 interface 1x external flash output 1x external trigger input 2x external GPIO 1x ext
56. ernal 12C bus free C C API Linux drivers and demos available 11 4 Design BudkaLTS BudkaLighting l ES l l l l l l l I 7 O LJ UI 1541LE i BSM4016S12 I BudkaLighting ELB149C5M UI 1541LE BSM6016512 CE BudkalRBar 12V Figure 7 Peripheral scheme of the control board BudkaControl depicting board peripherals assigned to peripheral devices Figure 8 Photo of the UI 1541LE monochrome industrial camera From 11 12 4 1 Hardware Each camera should monitor different scene implying different viewing angles as illustrated in Figure 9 For this sake different lenses were mounted on each camera The fly in camera was equipped by a lens BSM4016S12 f 4 mm 96 horizontal field angle S Mount to fulfil reguirement of viewing the whole front side from the fly in hole to the box ground and the ground camera was equipped by a lens BSM6016S12 f 6 mm 65 horizontal field angle S Mount allowing for viewing the bottom half of the box Both lenses are distributed by IDS too 20 20 Figure 9 Approximate cameras viewing angles derived from expected box dimensions in centimetres Violet The fly in camera and its reguired field of view Green The ground camera and its reguired field of view 4 1 3 Infrared Lighting The camera chip is not covered by any IR cut filter allowing for sensitivity on the IR light Graph of the chip sensitivity with respect to the light wavelen
57. erter MCP3221 3 Photocell VT83N2 The board is produced in two instances Both instances are placed by a MCP9804 IC digital temperature sensor with 0 25 C typical accuracy and 40 C to 125 C 42 5 2 Software operation range 17 The exterior sensors board is also placed by a MCP5221 low power I C 12 bit A D converter 37 measuring the voltage on the photocell VT83N2 38 The board is designed to fit in a capsule of a pen or marker and isolated by silicone rubber as visible on the realistic photographs in Appendix D Figures 62 and 63 It is attached to the terminal strip on BudkaControl board by a four wire cable according to the colour scheme in Table 3 5 1 5 RFID Reader The RFID reader selected during the system design ELB149C5M Section 4 1 4 is mounted directly to the control board as described in Section 5 1 1 The external antenna was manufactured by Libor Hofmann 39 following the dimensions from Fig ure 13 Its photo is shown in Appendix D in Figure 64 The antenna is connected by a two wire cable to the original white connector on the reader module 5 1 6 Cover Tamper Button As an additional feature the terminal strip on the control board contains two signals for Tamper Detect It is used to connect a button serving as a detector of the battery door being open closed The TAMPER1 signal is connected to the input of Tamper peripheral on the Vybrid MCU When the main power supply is not provided that per
58. es an alternative way to share the medium as described previously in this paragraph and is used in this application for all MAX file operations rtc is a simple set of functions for date time operations e g generating time stamps for log and other purposes wifi is a complex module containing the driver for the AR4100 Atheros wifi SIP On the top of the driver and the MAX TCP IP stack access point and managed modes are implemented This module can be used for the WiFi human machine interface 4 2 3 Processes and Tasks From the processes and tasks point of view the application gets pretty complicated The overall processes tasks diagram is depicted in Figure 22 In MAX the whole application is formed of a single executable binary containing the OS kernel drivers and user program Individual subprograms are implemented simi larly to threads but are called tasks and play the role of processes in the Linux Windows terminology For this reason MQX tasks and Linux processes in Figure 22 are shown on the same level of abstraction They are described in the following subsections appmgr appmgr is the name used for two executable entities an MOX task appmgr and a Linux process appmgr They form two sides of the main core of the Birdhouse application They are the only executable entities which perform the inter core com munication if not counting the MCFS subsystem forming the application s backbone 24 4 2 Software
59. escale s processors and BSPs for their development boards Timesys LinuxLink The Leading Software Development Framework for Embedded Linux Support Linux Kernel gt P 1 User Guides I a h Development Tools i Middleware amp Applications Bootloader TimeStorm IDE Figure 20 Typical LinuxLink framework flow From 22 Second although LinuxLink is a commercial service a long term professional license is granted to every customer who purchased TWR VF65GS10 24 the Vybrid devel opment board by Freescale Elnico the manufacturer of the SQM4 VF6 W Vybrid 21 4 Design module Figure 6 and developer of the BudkaControl board design described in Sec tion 4 1 1 realization in 5 1 1 is a LinuxLink licensee and can provide custom Linux configuration and build through this tool And finally Timesys develops and distributes the mcc kmod package 25 a Linux kernel module providing communication with the MQX MCC library see section 4 2 2 That is using the Linux by Timesys we can get well prepared and supported Linux distribution allowing communication with MQX running on the second core 4 2 2 Libraries Selection of the essential software libraries used by the application is a fundamental task which has to be done in the software design phase In this case uEye MCC and ESL libraries belong to such category uEye Library uEye is a software library for Ul cameras control provided by their
60. g can hardly be performed without undergoing the real 7 day test 6 1 2 Prey Simulation The second experiment was to simulate the bird fly in with prey delivery and collect recorded data as it was in real operation Since the experiment was taken at daytime switch to the READY mode was enforced manually using the testing on board buttons see Section 5 1 1 Instead of the prey living hamster was used being simply thrown into the nest box by hand Please note this experiment did not cause the hamster any harm When the hamster first disrupted the light barrier door camera started recording of 3 seconds long seguence with 10 fps frame rate The first frames captured the ham ster falling inside the nest box as shown in Figure 41 The remaining frames did not carry any useful information Immediately after the door recording stopped the floor camera started recording its 60 seconds long seguence with 1 fps frame rate The ham ster moving on the box ground was recorded 3 subseguent frames are for illustration depicted in Figure 42 Content of accompanying data tzt file is listed below Date Mon Apr 7 13 24 26 2014 RFID NONE Temperature internal 19 50 C Temperature external 18 75 C Ambient light 1281 Complete data including the sensor readouts and application logs can be found on the accompanying DVD in the experiments indoor directory see Appendix A It shows that the application operated correctly and recorded all data as e
61. g to their colours is listed in Table 3 Next to the terminal strip there is one expansion connector 7 with additional GPIOs SPI and few more signals It is currently unused though For development and debug purposes there is one serial connector 6 attached to an RS 232 debug port one reset and three debug testing buttons 9 and a low power LED for signalizing the application status 40 5 1 Hardware To implement the WiFi interface there is a prepared space for the RTX4100 WiFi module 12 and an antenna connector 13 This was meant as a fall back solution in case of problems with the AR4100P WiFi SIP placed on the SQM4 VF6 W module An the end it was not even tested due to a very low throughput as it is designed for extremely low power applications 33 The AR4100P WiFi SIP on SOM4 VF6 W module will be used instead when the collision of ESL with Linux kernel is solved as described in 4 2 3 U FL Male connector 11 for connecting the WiFi antenna is prepared on the processor module The board dimensions are designed to fit in the ELBOX 17127121255 transp installa tion box with protection IP65 34 by Enika cz s r o Enika Photographs of the board covered and installed in the nest box can be found in Appendix D 5 1 2 Camera and Lighting The BudkaLighting board was realized as a simple two layer PCB directly connected to the UI 1541LE camera See its schematics in Appendix B 2 routings and silkscreens in Appendix C 2
62. g trigger communication illustration appmgr L MCC message message ueyerec Even though the uEye library contains a set of functions for outputting AVI video files it is not available for Linux For this reason each frame has to be processed manually When the camera emits the FRAME event signalling a new image frame is ready in the buffer ueyerec saves it as an image file The images stored to the buffer by the uEye API are in standard 8 bit grayscale format and 1280x1024 px dimensions taking 1 310 720 Bytes of memory The sim plest and fastest method to store that as a standard image file is to use the Portable GrayMap PGM format 42 in its binary form It just adds a very simple header before the binary data as shows the listing below P5 1280 1024 255 lt binary data gt On the first line the format identification number is printed There are six en coding options available 4 BitM ap GrayM ap PixMap x ascii binary P5 repre senting the binary GrayMap encoding The second line states the image dimensions and the third line states the colour space scale 0 being always black and the given maximum value here 255 always white PGM format has advantage of an easy implementation and a fast export On the other hand the output is too large 1 310 737 Bytes 1 25 Megabytes including the header so only a limited number of frames can be stored in the file system That would not be a critical problem as
63. gth is depicted in Figure 10 In the wavelength range of 700 900 nm the chip sensitivity falls steeply with the growing wavelength with only approximately 23 of full sensitivity at 900 nm wavelength For this reason the wavelength of the camera lighting should be rather close to 800 nm where the efficiency is much higher about 40 Thanks to the external flash output of the UI 1541LE cameras the lighting can be controlled right from the cameras It was decided to develop a special board named BudkaLighting implementing the infra red lighting functionality As the cameras have no covering the board was designed to be directly connected to the camera and covered together in one box protected on level at least IP54 dust and partial water protection As the light source TSHG5510 IR LED by Vishay was picked Main reasons for this type were its peak wavelength Ap 830 nm and a high angle of half intensity 389 promising a uniform illumination of the whole scene Graphs of the relative radiant power intensity with respect to the wavelength and angular displacement are shown in Figure 11 More technical information can be found in 12 13 4 Design 14 IR Cut F ter 650nm 400 500 600 700 850 900 Wavelength tnm Figure 10 UI 1541LE M GL camera chip sensitivity on different light wavelengths From 11 z e eo c z 2 E E S 8 5 E is 2 9
64. icrocontroller MFS MS DOS File System MPU Mcroprocessor Unit microprocessor NACK non acknowledge OS operating system xiii PC PCB PGM PIT PSP PWM PX RAM RFID RFS ROM RTC RTCS RTOS SD Sw SIP SOM SPI TCP TCP IP UART UI USB V4L WDOG Personal Computer printed circuit board Portable GrayMap Passive Integrated Transponder Processor Support Package Pulse Width Modulation pixel Random Access Memory Radio Frequency Identification Root File System Read Only Memory Real time Clock Real Time Communication Stack real time operating system Secure Digital software System in Package System on Module Serial Peripheral Interface Transmission Control Protocol Transmission Control Protocol Internet Protocol Universal Asynchronous Receiver Transmitter user interface Universal Serial Bus Video4Linux watchdog Names and Trademarks List of often used company names and their products and trademarks ARM Cortex Elnico Enika Factory Freescale IDS Linux MOX SQM4 Timesys Windows Xiv ARM Cortex Elnico s r o Enika cz s r o LinuxLink Factory Freescale Semiconductor Inc IDS Imaging Development System GmbH Linux OS Freescale MQX SQM4 Timesys Corporation Microsoft Windows OS 1 Motivation The assignment of this diploma thesis is motivated by the research of Ing Mark ta Z rybnick Ph D from the Czech University of Life Sciences Prague She is interested in g
65. ig to fit in the internal memories and many programmes being run under Linux are even bigger For this reason both Linux kernel and Linux applications need to be first loaded to the Random Access Memory RAM from where they are executed Linux kernel needs to be loaded first which is done by a bootloader U Boot in our case It is a small application which could be written into the on chip ROM memory but it is typically stored on a data storage 45 5 Implementation In our application U Boot is loaded from the MicroSD card The U Boot binary is written directly to the SD card memory address 0x400 at a place of no partition The Vybrid MCU is implicitly configured to load the program from this location When U Boot starts it initializes the main peripherals e g memories and mounts the file system on the first SD card partition named KERNEL Linux kernel binary is stored there file uImage 3 0 ts armv l see directory linux sdk on the DVD and Appendix A This file is loaded into the memory and executed by the primary core A5 the secondary core M4 was not initialized yet and its clock is off One of first steps of the Linux boot is to mount the Root File System RFS located on the second SD card partition It contains all files needed to start and run the system including the application data During boot system init scripts from the etc init d directory are seguentially executed with respect to their alphabe
66. including a client communication with ueyerec These operations are depicted in Figures 28 and 29 In A5 SET READY operation Figure 28 appmgr powers on both USB chan nels and tries to run two instances of ueyerec each for one camera This operation labelled as START UEYEREC first involves forking and running a new process in stance of ueyerec This process is given an inter process communication IPC queue identifier ID of appmgr To allow for bidirectional communication appmgr needs to know IPC queue ID of the new task that is done during a three step handshake illustrated in Figure 30 First ueyerec sends a HANDSHAKE1 message with ID of its IPC queue appmgr replies by HANDSHAKEZ2 message with system process ID of the ueyerec process which replies by an empty HANDSHAKES message playing a role of simple acknowledge ACK By that the IPC communication between these two tasks is established appmgr then instructs ueyerec to get to the Ready mode by opening ac tivating and configuring the camera messages OPEN ACTIVATE SET EXPOSURE and SET GAIN Full collection of used IPC messages and their parameters is listed in Table 2 27 4 Design SET SLEEP Is Ready No power off RFID IRBAR Figure 24 SET SLEEP operation flowchart executed by appmgr Violet blocks represent MCC communication The red block is illustration of corresponding A5 operation appmgr In A5 SET SLEEP operation Fig
67. ing Mar 25 2014 URL http en wikipedia org w index php title Real time computing amp oldid 601138241 visited on 04 09 2014 Freescale Semiconductor Inc Freescale M qx Real Time Operating System RTOS URL http www freescale com webapp sps site overview jsp nodeId 01521060795BB6 visited on 04 10 2014 RTwiki Real Time Linux Wiki URL https rt wiki kernel org index php Main_Page visited on 04 10 2014 Timesys Corporation Timesys LinuxLink Embedded Linux Build Systems URL http www timesys com embedded linux build systems visited on 04 10 2014 Wikipedia TimeSys July 23 2013 URL http en wikipedia org wiki TimeSys visited on 04 10 2014 Freescale Semiconductor Inc TWR VF65GS10 Vybrid Controller Solutions Tower System Module URL http www freescale com webapp sps site prod_ summary jsp code TWR VF65GS10 parentCode null nodeld 0152106740B1EC0D68 visited on 04 10 2014 Timesys Corporation Index of buildsources m mcc kmod URL http repository timesys com buildsources m mcc kmod visited on 04 10 2014 Wikipedia BeagleBoard Apr 10 2014 URL http en wikipedia org wiki BeagleBoard visited on 04 03 2014 Wikipedia ARM architecture Apr 10 2014 URL http en wikipedia org wiki ARM_architecture visited on 04 10 2014 39 40 41 42 43 44 Bibliography IDS Imaging Development System GmbH Index of frontend files support u
68. ipheral is powered by the 3V backup battery so it can detect unauthorized access even in the case of disconnected discharged battery This functionality has not been implemented in the software yet though 5 2 Software The Birdhouse application software has been implemented following the design de scribed in Section 5 2 Some implementation details and application use guidelines will be described here 5 2 1 Toolchain Toolchain is a set of tools and libraries used to develop the application The Birdhouse application being run on two different systems in parallel has been developed under two toolchains GNU for Linux application development and IAR for MQX application development Linux For implementation of the Linux side of the application LinuxLink Factory Factory build system has been used It enriches the GNU toolchain 40 by a few omissible tools advice engine and upgrade engine more at 22 GNU toolchain is a collection of programming tools produced by the GNU Project licensed under a sort of GNU General Public License GPL licenses typically Lesser General Public License LGPL the software can be used for free even for proprietary commercial projects The GNU toolchain consists of tens of tools The key tools are GNU make build automation tool GNU Compiler Collection GCC C and C compilers GNU binutils linker assembler GNU build system autotools and GNU Debugger GDB code debugging tool
69. l application tasks appctrl appctrl is an MOX task which supplies eslAppCtrl in the tasks control function Any way it currently controls only appmgr which is the main task of the application and every critical failure of any subsystem earlier or later projects to failure of appmgr The appctrl task cycles in an infinite event loop receiving events from appmgr and a periodic timer with a shorter period then the expiration delay of the hardware watchdog In every cycle it services the HW watchdog and increments a counter When the counter exceeds predefined threshold the task resets the MCU To avoid hardware 35 4 Design reset the counter must be reset to zero by receiving the event from appmgr notice the Service WDOG block in Figure 23 effectively realizing SW watchdog of that task irBarrier irBarrier is an MOX task intended to control the BudkalRBar board That involves generation of a periodic signal for the light transmitter and evaluation of input from the receiver The periodic output signal of required frequency 38 kHz is generated by the FlexTimer FTM peripheral configured to the PWM mode When the barrier disruption is detected irBarrier signalizes it to appmgr by setting the RECORD event The task also provides an interface for disabling and enabling the IRBAR so it can be powered off in the SLEEP mode to save the power resource elb149c5m elb149c5m is an MQX task that performs readouts fro
70. ll run autonomously and fully automatically no remote control mecha nism is desired Recorded data will be collected on weekly basis together with the power supply replacement To achieve reguested scientific value of the research higher number of such intelligent nest boxes is needed the ideal count is twelve That means that it must be possible to produce such a number of boxes for a reasonable price so the components need to be selected with respect to the cost and availability 3 State of the Art Nest monitoring is a freguent task in life sciences particularly in ornithology It gives scientists valuable data about population growth nest attentiveness parental care nest predation birds diet and birds behaviour in general Multiple different approaches can be taken each limited by the observation purpose observed species financial and human resources and other constraints 3 1 Direct Observation A direct observation is technologically the simplest method used in nest monitoring It is based on a periodic visual exploration of nests either locally or from a distance e g using binoculars This method is useful mainly for checking the number of laid eggs number of hatched chicks whether the nest has not been abandoned or predated The first main limitation of this method is induced by the monitored species which can either nest at inaccessible places for example rocks or be particularly sensitive to human presence Th
71. lly emitting an IR light Receiver is located opposite to the transmitter and detects whether the space between both parts is clean i e the light excites the receiver or the beam is disrupted by a non transparent object The light is usually modulated by a periodic signal of a defined frequency all other frequencies are filtered by the receiver providing the high robustness against ambient light sunlight artificial light sources of different frequencies There are plenty of commercial products available on the market being used for example for gate control or toilets flushing These devices have usually a relatively high power consumption big packaging and high cost The majority of them perhaps most of them are also designed for too high voltage often 230 V For these reasons it was decided to develop and manufacture a custom light barrier on a board named BudkalRBar The receiver TSSP58038 by Vishay technical spec ification in 15 is designed for 38 kHz pulses of IR light with the highest sensitivity 15 4 Design at 950 nm and can be powered from 2 5 V to 5 5 V The transmitter TSAL5100 by Vishay technical specification in 16 is a simple IR LED with peak wavelength Ap 940 nm and a narrow beam angle of half intensity p 10 The output sig nal of a reguired freguency needs to be generated by an external source Pulse Width Modulation PWM peripheral of the processor will be used for that The board is designed
72. m the ELB149C5M RFID reader It simply reads the data written to the Universal Asynchronous Receiver Transmitter UART peripheral and checks the checksum The EM4200 code contains 10 ASCII data characters representing a hexadecimal code followed by a 2 bytes long checksum cumulative XOR of the previous 5 subsequent pairs of bytes see an example in 14 If the read checksum equals the computed checksum the code is correct and its decimal representation ignoring the first 2 HEX characters is stored to a variable together with current timestamp This is read by appmgr during the RECORD operation see Figure 26 and if the code was scanned near the time of the RECORD event stored together with the recorded video data The task also provides an interface for disabling and enabling the reader for the same reasons as the irBarrier task adc adc is an MOX task which measures the power supply voltage using the MCU s A D converter ADC peripheral The purpose of the task is to inform about the battery state and if the voltage is too low power off the system The value calculated as a sliding average of last 60 measurements is reported to the sensors task which integrates it into its output sensors sensors is an MQX task which periodically aggregates data from the temperature and light sensors IC communication with the BudkaLTS board and battery voltage from the adc task and writes them to the MCFS file system hmi h
73. manufacturer IDS Imaging Development System GmbH It contains drivers with a daemon process Application Programming Interface API examples and few utilities It provides the only way to access and control the cameras as they do not comply with common video standards like Video4Linux VAL The library is proprietary and is distributed only in the binary form the source files are not available Use of the library and thus the UI cameras hence depended on availability of suitable binaries for the ARMY Cortex A5 platform No such li brary distribution existed Nevertheless after some tries it appeared that a distribution for BeagleBoard can be used BeagleBoard is an open source hardware computer with an ARM Cortex A8 processor 26 The A8 and A5 cores have the same architecture ARMv7 A so they feature the same instruction set 27 For this reason the binaries built for BeagleBoard are compatible with the A5 core on Vybrid VF6 even though they are not optimized for use on this MPU The latest uEye library distribution for BeagleBoard uEye version 3 90 was downloaded from 28 up to date PC binaries and documentation is available from 29 The library features a C C API providing a high number of functions briefly e Preparing image capture camera opening and closing querying library and cam era information image buffer allocation and freeing e Camera configuration getting and setting camera pixel clock exposure gain
74. me are the interior and exterior sensor blocks which were not present on the referential design The system uses the light barrier as an event detector too referred as Movement detector in Figure 3 Even though it might seem to be redundant since RFID reader could also be used for the same purpose experiences with the referential solution have shown that the reader reliability is not completely satisfiable as the PIT tags sometimes fail to be scanned The following subsections describe briefly each block of the scheme in terms of what device has been selected and why without discussing other alternatives as this has already been done in 8 in terms of the subject A4M33SVP 4 Design 4 1 1 Control Board The central block of the system is a control board with the following reguirements Provides hardware interface to all needed peripherals allows for running Linux OS Linux is powered by a powerful microcontroller MCU microprocessor MPU has a low power consumption is well documented is guaranteed to be available for several years can be acquired for a reasonable price No commercially available solution fulfilling all listed reguirements was found so it was decided to let develop and manufacture a custom board As a suitable platform a new Freescale Vybrid VF6 microprocessor was chosen bringing all the features dia grammed in Figure 5 7 Vybrid VF6xx Block Diagram Debug and Trace Analog saa T2b
75. mi is an MOX task serving as a simple testing interface It presents the internal appli cation state via a LED blinking with different frequencies and it controls the appmgr task via a set of debug buttons These devices have little to no use in the final appli cation though as they are inaccessible in practice wifi httpd ftpd wifi task is intended to initialize configure and control an access point of a wireless network realizing the user interface of the system httpd and ftpd tasks are meant 36 4 2 Software to operate the Hypertext Transfer Protocol HTTP and File Transfer Protocol FTP servers accessible through the wireless network Due to a collision in DMA operation caused probably by use of the same channel by both the MQX wifi driver and Linux kernel the Wi Fi functionality is only roughly prepared but could not be completed The problem must be fixed on the level of either ESL library or Linux kernel eslLog eslLog is an ESL task processing all logging messages from the application and the ESL library itself Its purpose is to serialize the messages and write them to a predefined medium standard output and or a file It provides a simple interface for logging messages of multiple severities debug information warning and error 37 5 Implementation The system implementation was determined by its design and was also already par tially described in Chapter 4 since design and implementation of such a com
76. nd computationally expensive i e slow algorithm so the maximum frame rate is limited by this operation instead Standard libjpeg library is able to produce only about 1 frame per second on our plat form An alternative library libjpeg turbo was found allowing to save from 5 to 6 frames per second without apparent regressions on output guality and size comparisons with libjpeg in 44 That is sufficient for the floor camera but not enough for frame rate reguested from the door camera To sum it up PGM export is fast as long as the output files fit in the file system write buffer but they do not fit there all On the other hand all frames encoded as JPEG might fit in the buffer after some size optimizations but the export is too slow by design A compromise solution was taken Instead of writing the output files directly to the SD card file system the big enough write buffer was emulated by creating a ramdisk in Linux file system That is done by adding the following line to etc fstab see Appendix A tmpfs mnt tmp tmpfs defaults size 90m 0 0 It specifies to create a disk of type tmpfs i e a temporary file system stored in a volatile memory RAM and mount it under mnt tmp Its size is set to 90 MB which is enough for storing up to 71 PGM image frames and yet leave enough free RAM for the operating system and other running processes The default capture configuration 3 seconds x 10 fps door camera 60 seconds x 1 fps
77. nd control the cameras see 4 2 2 is available only in the binary form for Windows PC and Linux under a limited number of architectures Use of the latter operating system on the A5 core is hence inevitable Analogously to communicate with the AR4100 WiFi SIP see Section 4 1 7 an op erating system supported by the wifi driver has to be selected From the sparse list of supported operating systems Freescale MQX MQX real time operating sys tem RTOS was picked MQX RTOS Freescale MQX is a real time operating system provided by Freescale Semiconduc tor Inc Freescale It is free to use with all Freescale MCUs and MPUs It features a lightweight component based microkernel with a highly customizable architecture as depicted in Figure 18 It is a multi platform OS with a minimal footprint of necessary components Core allowing to be used on most Freescale based devices The kernel includes a real time priority based pre emptive scheduler allowing for real time multi tasking and fast interrupt handling extensive inter task communication and synchro nization facilities 20 19 4 Design MQX RTOS Customizable Component Set Name Queues Services Interrupts Partitions Messages Task Utilities Events Management Task Errors Initialization j Lightweight Core Memory semene Watchdogs Semaphores Core Services Task Queue Automatic Task o Timers Scheduling Creation RR and FIFO IPCs Scheduling Formatted Exception Vo
78. not very accurate An example data might look as listed below The example presents records from five following readouts collected on April 15 2014 after 8 pm Since it is just about sunset it registers the fall of the exterior light and both interior and exterior temperatures Slight descent of the source power voltage is also noticeable even though the absolute value is inexact 2014 04 15 20 03 00 14 50 C 22 50 C 2014 04 15 20 03 30 14 50 C 22 25 C 2014 04 15 20 04 00 14 50 C 22 00 C 25 C 3442 12 253 2014 04 15 20 04 30 14 50 C 22 00 C cS Cy 109223 2014 04 15 20 05 00 14 50 C 22 00 C 0 25 C 3433 12 254 250 705 3487 12 256 A CG SHS ALAS lt S S S When collecting the data the user typically needs to download all content of data and sensors directories The content of log directory should also be regularly checked for system failures If the system is in use for a higher number of cycles the content of all these directories should be regularly cleared to ensure enough free disk space for further operation When performing cleanup it is important to preserve the original directory tree that is the four top most directories and the configuration files 50 5 2 Software Typical maintenance procedure might consist of the following steps Attach Ethernet cable Establish FTP connection Copy directories data log and sensors Check if the downloaded data is complet
79. olerable but may degrade the systems qual ity of service The usefulness of a result is zero after its deadline e Soft The usefulness of a result degrades after its deadline thereby degrading the system s quality of service 19 The Birdhouse application can be categorized as a soft real time system posing real time requirements on the delay between the light barrier disruption and start of record ing by the door camera The requirements were not defined specifically but they can be derived from the need to record at least 3 frames of the prey by the door camera before it falls on the ground i e out of the camera view As the prey occurrence takes about 500 ms the recording must start with respect to this duration and the camera frame rate From the user point of view the best would be if the recording started 18 4 2 Software S 4 O a o lt js un gt un tema El 4 BSP PSP BSP PSP 2 MOX 9 Freescale Vybrid VF6 9 o a Peripherals Figure 17 The system software block diagram from the HW OS point of view All application specific parts implemented in terms of this work are labelled in underlined bold font immediately i e the system should minimize the time delay between the disruption event and recording start The freedom of selection in this application has been limited from the beginning though The uEye library needed to access a
80. one hand and a high amount of potentially valuable events which are not recorded on the other hand This approach has been taken for a research of siblicide in bearded vultures Gypaetus barbatus To observe aggression between two sibling chicks and death of the younger one the authors used quite complicated apparatus comprising of two parts 1 a nest monitoring subsystem camera microphone battery with a charge controller and a trans mitter together with an antenna which was supported by a solar panel and 2 a record ing subsystem antenna receiver video signal controller and a remote controlled PC through a GSM modem that compressed the audio video signal and provided real time monitoring 3 The nest monitoring subsystem featured a waterproof colour 640x480 camera with 1 3 inch CCD chip and a 3 6 mm lens with 78 wide field of view It was scheduled to record one 15 minutes long video shot at the frame rate of 25 frames per second fps every two hours The control PC ran the Windows XP operating system The system was powered by a 100 Ah battery supported by a 75 W solar panel with out which the battery would discharge after a period of 4 days The system structure is illustrated in Figure 2 17 16 Figure 2 Structure of the video surveillance system used to monitor a bearded vulture nest 1 9 Nest subsystem 10 16 local subsystem 17 central subsystem From 3 3 3 Event based Recording A m
81. pert human recognition is reguired as there is a high variety within hunted species For this sake a pair of Infrared IR High Definition HD cameras is used The first camera records the entrance hole The second camera records the nest box ground Both cameras are eguipped with an IR flash The system is further eguipped with an IR optical barrier to detect owls flying in the nest box and reduce memory and power reguirements by starting the recording only at the time of an event of interest and stopping it afterwards Two temperature sensors and one sensor of the ambient light are included to provide more information about nesting for research purposes All captured data is stored permanently on a local filesystem and can be collected through a File Transfer Protocol FTP connection using a wired local network The whole system is powered by one 60 Ah 12 V traction battery which allows for approximately one week long autonomous operation of the system 2 Task Formulation Reguirements on the embedded system to be developed are given by the planned re search project described in 1 Authors of the project are researchers from a team from the Czech University of Live Sciences Prague Faculty of Environmental Sciences Department of Ecology leaded by Ing Mark ta Z rybnick Ph D They will be fur ther referred to as the ornithologists in this document The main focus of the project is posed on the camera surveillance system The princip
82. pletely new and complex system go hand in hand This chapter describes mainly the prod ucts of the implementation that is resulting hardware and software equipment and its practical use 5 1 Hardware All the commercial hardware selected in Section 4 1 was procured all the custom hard ware was developed and manufactured by Elnico s r o This section presents the result ing products 5 1 1 Control Board The BudkaControl control board was realized as a simple two layer printed circuit board PCB See its schematics in Appendix B 1 routings and silkscreens in Appendix C 1 Labelled photo of the board is shown in Figure 33 Figure 33 Realization of the BudkaControl board 1 SQM4 VF6 W processor module 2 ELB149C5M RFID reader with antenna connector 3 Terminal strip for power source and peripheral boards connection 4 MicroSD card slot 5 RJ45 Ethernet connector 6 RS 232 debug port serial connector 7 Expansion connector 8 3V battery holder 9 Reset and testing buttons 10 Status LED 11 U FL Male WiFi antenna connector 12 RTX4100 WiFi module footprint not placed 13 WiFi antenna connector for RTX4100 module not used 39 5 Implementation Clamp Peripheral Function J12 2 Power Supply 12V J12 1 Power Supply GND J18 2 Tamper Detect TAMPER1 J18 1 Tamper Detect GND J6 2 Camera 1 PCED J6 1 Camera E E J142 Camera GPIO2 J14 1 Camera GPIO1 TRIGGER J20 1 Camera 1 1 1 J20 2
83. pot eb syst mu Pot jsou vybr ny platformy Linux OS a Freescale MQX RTOS pro paraleln b h na dvouj drov m mikroprocesoru d c m hlavn desku Pro tyto ope ra n syst my jsou vyvinuty aplikace pro po izov n videa a zen syst mu prost ed je nastaveno pro umo n n p stupu k dat m a konfigurov n za zen P i ka d m vniknut sovy do vletov ho otvoru budky vznikl syst m zaznamen v video z znamy ve vysok m rozli en spole n s identifika n mi daji sovy a data o sou asn m stavu pro st ed V z v ru jsou prezentov ny v sledky prvn ch experiment po um st n za zen do c lov ho prost ed na za tku hn zdn sez ny roku 2014 Kl ov slova Kamera monitorov n sovy vestavn syst m sb r dat iv Abstract This diploma thesis describes design and implementation of an autonomous video surveillance system embedded in a bird nest box needed for research of boreal owl in its natural environment First a custom hardware eguipment is proposed and de signed It is then developed and manufactured by Elnico s r o Linux OS and Freescale MQX RTOS operating systems are selected as software platforms running on a dual core microprocessor in parallel Video recording and system control applications are developed and the environment set up to allow data access and system configuration The resulted system produces high definition video records triggered by a bir
84. pplication binaries and complete system control All these possibilities are available when accessing the system through ssh or telnet services being logged in as the root user That should be done by experienced users only though Standard use of the system should not require that level of administration 52 6 Experiments When the system was finally successfully completed multiple experiments were per formed to verify its proper functioning This chapter describes those most important 6 1 Indoor Testing Two main experiments were performed indoor validating the system is ready for au tonomous use outdoor 6 1 1 Power Consumption First it was needed to check if the system is able to run autonomously for seven days without the need to change the battery Because the ornithologists wanted to use it for their outdoor research in Spring 2014 breeding season there was not enough time to do a week long test with the battery For this reason it was decided to measure instan taneous power consumption by ammeter and compute theoretical length of the system run without the need to replace the battery The system was powered from hard 12 V power source It ran continuously from one day afternoon to second day morning so both SLEEP and READY modes were run for long enough time In the READY mode the light barrier was disrupted multiple times so the RECORDING mode was tested too In all modes several measure ments of instantaneous powe
85. queue id HANDSHAKE2 process id _ _ gt 3E C HANDSHAKE3 OPEN A Y SUCCESS ACTIVATE e lt SUCCESS SET EXPOSURE exposure lt SUCCESS SET GAIN gain po SUCCESS Figure 30 Inter process protocol illustration on case of operation START UEYEREC Yellow messages are sent from ueyerec to appmgr the red ones in the opposite direction 33 4 Design ueyerec ueyerec the name comes from UI recorder is the only program designed to access and control the cameras or better to say the camera two program instances are needed to control two cameras It serves as a server for appmgr It provides commands to open configure and close a camera and to take a snapshot or record a seguence of video frames The program again cycles in a message gueue as depicted in Figure 31 Messages are received first from the user interface UI second from the connected camera and third from a periodic timer data flow messages flow Initialization V V Camera message loop ne Figure 31 Simplified ueyerec functionality diagram illustrating data and messages flow inside the program On the target device ueyerec UI stands for the IPC communication with appmgr being a source of commands corresponding to the camera control messages from Table 2 The camera produces several types of e
86. r consumption were noted Their averaged values are listed in the second column Current Table 5 Mode Current Power Holding Time SLEEP 169 mA 2 03 W 14 77 days READY 308 mA 3 70 W 8 11 days RECORDING 351 mA 421W 7 12 days Table 5 Averaged measurements of instantaneous system power consumptions From the knowledge of the power source voltage the system power was computed I U current 12 as listed in the third table column Power The theoretical battery capacity is 12 V 60 Ah 720 Wh from where the length of continuous run in given mode was computed Holding Time The table shows that the system should theoretically be able to run for seven days even in the RECORDING mode Here it is important to admit that accuracy of this mode consumption measurements was not probably very good as the flashing IR light ing causes short but high consumption peaks which are not possible to be measured by a simple ammeter Anyway taking into account the results of the SLEEP mode and READY mode theoretical holding times their combination according to the default configuration gives about 11 days holding time A few tens of minutes of the RECORDING mode being active each night should not change the results too much In any case the reserve 53 6 Experiments should be big enough to guarantee a week long run of the system without damaging the battery More exact power consumption testin
87. r reguirements while developing the nesting box computer Document your results both from a designer and user point of view Bibliography Sources Will be provided by the supervisor Diploma Thesis Supervisor Ing Pavel Krsek Ph D Valid until the end of the winter semester of academic year 2014 2015 L S doc Dr Ing Jan Kybic prof Ing Pavel Ripka CSc Head of Department Dean Prague August 20 2013 Contents 5 Motivation Task Formulation State of the Art 3 1 Direct Observation 3 2 Continuous Recording 3 3 Event based Recording Design 41 Hardware less 4 1 1 Control Board 4 1 2 Cameras xu eros eS 4 1 3 Infrared Lighting 4 14 RFID Reader 4 1 5 Light Barrier 4 1 0 Temperature and Light Sensors 4 1 7 User Interface A2 SOLUWAEG ir is 4 2 1 Operating Systems MQX RTOS Timesys Linux OS 42 2 Libraries s 44 304 63 uEye Library MCC Library ESL Library 4 2 3 Processes and Tasks ADDIPE 24e yd de dew ueyerec lt lt ueyeusbd MESA peice sd Rok yy Rs eslAppCtrl appetrl 2 5 240 4 abe es A Barrie tenn de age Be Ae xe elbld9cbm ades 40 46 cor bl SENSOIS lt lt lini tcu ve 2 a EU wifi httpd ftpd eslbog o ii ve Implementation 5 1 Hardware sn 5 1
88. rental roles in the nesting period 5 The requirements implied need of a night vision camera that is a camera sensitive on IR light and an IR flash to illuminate the content of the nest box The authors chose a DECAM camera module SINIT Czech Republic equipped with 16 MB data memory wireless data communication two logical inputs and one output for lighting control The camera was able to record 1 3 frames per second The flash was con structed from 24 IR Light Emitting Diodes LEDs SFH485 2 with 880 nm wavelength as it was the closest match for expected ideal wavelength of 900 nm Movement Chip detector reader device Interfacing block Figure 3 Conceptual design of device for monitoring nesting of the Tengmalm s owl From 5 As the used camera allowed for storing of a very limited number of pictures 1024 6 the system had to be equipped with a mechanism called motion detector so the camera 3 State of the Art could record only important scenes filtering out all the rest when there is nothing hap pening in front of it The motion detector was in fact an IR optical barrier constructed from through beam sensors KS96 Kotlin Czech Republic 7 with the frequency mod ulation The barrier was placed in the fly in hole so the light beam must be crossed by the bird entering the box The sensors could operate on 15 30 V DC The system was further eguipped with a PIT tag reader device PS02 Elvis Czech Republic
89. riments Figure 42 Three of frames captured by the floor camera in the prey simulation experiment uration was left unchanged The wakeup time was changed to 8 pm and the battery voltage thresholds were set to highly improbable values so the system does not turn off due to the voltage checks the low threshold was set to 12 000 mV verylow to 11 000 mV and critical to 10 000 mV The system was installed on Monday April 14 2014 in Ore mountains Czech Re public Figure 43 The ornithologists replaced a plain nest box occupied by nesting Tengmalm s owls by this system moving the nest including eggs to the new nest box and tagged the parents by PIT tags They powered on the system and left the place After 4 days on Friday April 18 2014 they returned and collected the data following the guideline from Section 5 2 3 without experiencing any problems In the end they replaced the battery and after evaluation that no serious problem occurred they left the place leaving the system running for the new cycle Er Figure 43 Installation of the nest box by ornithologists in the field The box is covered by additional plating Photos by the ornithologists Collected data was provided by the ornithologists for detailed analysis it can be found on the DVD in the experiments outdoor directory see Appendix A On the first sight the system worked very well According to the logs and number of files in the sensors 56 6 2 Ou
90. rrupt demultiplexer On Vybrid there is only one interrupt vector for each GPIO port When there are more then one GPIOs from the same port used the application needs to check on which pin from the port the interrupt originated That is done by this module i2c module is a set of functions for accessing the I C peripheral enforcing mutual access to each channel The 12C peripheral is used to communicate with the sensors on the BudkaLTS board see Section 4 1 6 log implements logging functions and a task responsible for writing the log messages to a defined location a UART standard output and or a file on a file system It collects logging messages from both the library and the application 23 4 Design Application Application gt MOX Hardware Hardware Figure 21 Elnico Support Library middleware diagram From 31 mcfs is a virtual multi core file system used to access a Linux file system from MOX It installs a file system into MAX and communicates using MCC with a Linux daemon running on the second core and actually executing the read write commands Since the whole dual core system disposes of only one non volatile memory storage Secure Digital SD card it has to be shared by both cores i e by both operating systems One solution would be to use hardware semaphores to synchronize access to the de vice which would probably reguire modifications in the Linux kernel Multi Core File System MCFS giv
91. sn Ast AS JEN sjeuBis pa10329A sajouag Jo lt gt Jeubis MOT 3AIPV se3oued E obesn jeuGis lepads v 4eun3pejnueuu ay UJ M Se Jaquinu au Ajuo exuaJ9jaJ 104 SI Jequunu ad exi eg pepeuuoo eouxpe e ae suoijeuiquioo 1919 10 JSA BWeS ay YIM papoo saul pojdnusju Z 2nA orpeje unununje ae sioede gt pozuejod Iv 2G ase sebe3 oA Iv jn ul ale siopnede Iv suyo UI Be SJO3SIS9J IV pajypads esiwieuyo SS JUN T alo swe er bne oZ se T y 0704 panozddy azea uotadrz0seq E SUOTSTASH Spejeudueqd 1IM 9JA HNOS wepe POS m 10 oN SPNO O OEL 73 HOWLNOO VXGNA HWOS ODINT3 ETOZ 8 plor aug OTN cain LOO E c Nvdx3 pue jnpoui 94A HW0S J0 Appendix B Schematics ano ADOT W0OT w ZIBDIOENZ ZA SWIOH LN ozy Lee TOY LNOO GNY DNIISAIL AN STADIN Yd M Deus 1S 3AOW3u AV as STADDING ems zs 1531 VYW STA DbIN ud 6 Pd 1531 30130 STAINS O ss vs 1031 105097 IXY tn3 4H2 TOWY L3d YAS ODZI XL TNTI 9HI OdWDV 9Dd NO COW UST S 2SN NIIS INDA TTAA SDd Hz siy twin low X1 ona1 n sn N I0 LINDd bOd tOd T AWANS S 0SN XY Ong N 1v DaH vTad XD 0SNAXL ONNA IV1XAH ETB TLNO 0OWLL3T LInO 02vG Zt8d Xu 051 53 ISIN IVLX4VVBBd XL OSMA 151 4 1VLX41 28d XI TSN NIOS 01ND4 Dd fd XM
92. tdoor Testing directory the system started three times The first two starts happened in the morning 9 51 and 10 04 of Monday 14th and the runs were very short apparently being just kinds of testing or configuration runs The last time the system started at 14 13 and it ran continuously until Friday 18th 8 22 when the battery was detached During the four nights 48 records were collected Almost half of the records 22 was captured during the first night because the female left and returned many times maybe the birds were nervous about the new nest box but it is not the deal of this document to discuss the birds behaviour There are from 6 to 11 records at the other nights Some of the records capture the female first leaving the nest and then returning back after few minutes The remaining records capture prey delivery by the male and its handover to the female Lets discuss deeply the Wednesday evening April 16 2014 The first record of that night 20140416 212555 941 was captured at 21 23 55 when the female left the box Fly out typically takes from 15 to 30 seconds so there is only feather visible on the door record see the left picture in Figure 44 First half of the floor camera record contains only feather too then the female leaves and empty nest is visible containing 4 eggs right picture in Figure 44 Figure 44 Record of the female leaving the nest box The left frame comes from the door camera the right frame
93. te operation is executed Should any of the operations fail the whole processor is reset immediately and the application must start again from the beginning recovering from the failure state SLEEP and WAKEUP events are triggered by a periodic timer They switch the ap plication to the READY mode at predefined evening time and to the SLEEP mode at predefined morning time The subsequent operations are depicted in Figures 24 and 25 Both operations are similar appmgr sends corresponding message to appmgr waits for reply and powers on off the RFID and infrared light barrier IRBAR devices through elb149c5m and irBarrier tasks 25 4 Design Message Protocol Description WAKEUP The server powers up the USBs and starts ueyerec for both the door and floor camera It replies with ACK where iParam is set to the operation result MCC OK on success MCC ERROR if something failed In the case of failure uParam contains additional information about which camera experienced problems The server remains in the READY mode anyway It is responsibility of the client to take appropriate action to fix the state SLEEP The server stops ueyerec for both the door and floor camera and powers down the USBs It replies with ACK where iParam is set to the oper ation result MCC OK on success MCC ERROR if something failed uParam then contains additional information about which camera experi enced problems RECORD To create
94. the RFID reader was found not to perform reliably and the overall power consumption was found to be perhaps higher then expected but that needs to be further tested In any case the overall results are very positive The lowest temperature measured by the exterior sensor was 4 75 C 60 7 Conclusion This document described the development implementation and testing of a new video surveillance system embedded in a bird nest box Such a system was needed by or nithologists from the Czech University of Live Sciences Prague for research of breeding and foraging strategy of Tengmalm s owl The work involved development of both hardware and software equipment of the sys tem It started by selection of appropriate platform and building blocks The system was built on the SQM4 VF6 W processor module with the new heterogeneous dual core microprocessor Freescale Vybrid VF6 The custom control board and several peripheral boards were developed and manufactured by Elnico s r o which also provided for free the development tools and libraries and exhaustive support Infra red light sensitive monochromatic HD cameras UI 1541LE by IDS Imaging Development System GmbH were used for video capturing The system software was based on two operating systems Linux OS on the first core and Freescale MQX RTOS on the second core Development of the application software involved design and implementation of a Linux video recording application and
95. the individual frames are deleted after being converted to a video file Practical problem arises here though a limited speed of writing to the MicroSD card where the file system is located in conjunction with data buffering That causes the frames being saved in clusters i e few subseguent frames are captured and saved correctly then ueyerec operation is blocked until the file system is ready for new writes and the process is repeated This is undesirable behaviour of course so another way of data exporting had to be found Joint Photographic Experts Group JPEG format conversion seemed to be promis ing It is an image format designed for realistic photographs using a lossy compression based on the discrete cosine transform DCT That allows to reduce image size signif icantly depending on the quality setting and the image content more at 43 In case of our video frames and 95 quality each image takes approx 150 kilobytes of space Since the memory sectors in MicroSD medium can handle only a limited number of writes 10k 100k the driver stores the data in memory buffer until full then it starts writing them to the medium blocking the file write operations for some time 47 5 Implementation Being almost ten times smaller all frames of one record might fit in the file system write buffer effectively avoiding the problems with PGM export Another problem arises here though JPEG compression is a complex a
96. the nest box Figure 68 Complete view on the intelligent bird nest box
97. thernet only the RJ45 connector needs to be placed on the base board The WiFi is implemented by the Qualcomm Atheros AR4100P chip The AR4100P is a small single stream 802 11 b g n WiFi System in Package SIP solution It is primarily designed for applications hosted by low resource microcon 16 4 2 Software trollers that send infreguent data packets over the network The system features extra low power consumption balanced by a lower throughput 18 The chip is placed on the bottom side of the SQM4 VF6 W module as shown in Fig ure 15 The module also features a tiny U FL male connector on the top side as visible in Figure 6 That can be used to connect the external WiFi antenna Figure 15 Bottom side of the SQM4 VF6 W SOM with the AR4100P WiFi SIP by Qualcomm Atheros 4 2 Software The main goal of this thesis is to develop an application serving all the hardware described in Section 4 1 and implementing all the functionalities described in Chapter 2 The application has been named Birdhouse The most general application flowchart is depicted in Figure 16 After powering on the device the system boots and depending on the daytime it enters either a Sleep mode with most of the peripheral hardware powered off light barrier RFID reader cameras or a Ready mode with all its hardware powered on In the Sleep mode only the temperature and light sensors are periodically read out with a predefined time period In the R
98. tical order all scripts beginning with the S character These scripts start services needed for the system run for example they install kernel modules and run network services The original init scripts generated by Factory can be found in DVD linux sdk rfs rootfs tar gz Custom application scripts are located in lt DVD gt sdcard rfs_overlay etc init d The first custom script S60 ftpd starts the BusyBox built in FTP server with access to the root app directory S60 vsftpd is an empty file which overlays the original file so the vsftpd FTP server is not started we need only one server 92 usb script configures GPIO outputs controlling power supply to the BudkaLighting board leaving the power off and starts udevadm service needed to properly detect attached USB cameras when the power is turned on S94 ueyerec is an empty file to disable direct start of the ueyerec application And finally S99 birdhouse starts the Birdhouse application The start involves execution of several commands First it loads the kmod mcc kernel module needed for the multi core communication with MQX through the MCC library Next it starts the appmgr process which further starts the remaining Linux programs and finally it starts the MQX side of the application by the following command mqxboot birdhouse_sqm4vf6_eb_m4 bin 0x3f000000 Ox3f000401 maxboot is a utility which loads an MQX binary file birdhouse sgm4vf6 eb m4 bin on a specified memory address
99. tion The red blocks are illustration of corresponding A5 operations appmgr 30 4 2 Software Figure 27 appmgr task flowchart Violet blocks represent MCC communication A5 SET SLEEP A5 SET READY A5 RECORD START A5 RECORD and A5 RECORD FINISH operations are depicted in Figures 28 and 29 31 4 Design Figure 28 A5 SET SLEEP and A5 SET READY operations executed by appmgr Or ange blocks involve IPC communication with ueyerec No Yes Figure 20 A5 RECORD START A5 RECORD and A5 RECORD FINISH operations executed by appmgr Orange blocks involve IPC communication with ueyerec 32 4 2 Software Message Parameters Description QUIT Auit the application OPEN Open the camera CLOSE Close the camera ACTIVATE Wakeup the camera from standby DEACTIVATE Sleep the camera to standby LIVE duration Capture a video of specified parameters framerate SET EXPOSURE exposure Set camera exposure time SET GAIN gain Set camera chip gain HANDSHAKE1 IPC queue ID First handshake message sent by server HANDSHAKE2 process ID Second handshake message sent by client HANDSHAKE3 Last handshake message sent by server SUCCESS Operation success sent by server FAILURE Operation failure sent by server Table 2 Inter process communication messages between appmgr and ueyerec processes lt HANDSHAKE1
100. to be placed in a groove milled in the front side of the nest box as illustrated in Figure 14 The board has a special shape so it goes around the fly in hole and the light beam crosses the hole horizontally in the middle El a A cable AAA Figure 14 Illustration of the light barrier design and its placement in a groove milled in the front side of the box 4 1 6 Temperature and Light Sensors Interior and exterior sensors are designed as separate tiny boards named BudkaLTS Both boards contain the temperature sensor MCP9804 by Microchip technical spec ification in 17 communicating on Inter Integrated Circuit 12C bus In addition the exterior sensors board features a 12 bit IC A D converter processing analog input from a photocell implementing a light sensor These parts are not placed on the interior sensors board The exterior sensors board is designed to be built in a nest box side in such a way the photocell is in the box exterior The interior sensor is not planned to be fixed on any place on the contrary it should be on a loose cable so the ornithologists can place it for example amongst eggs and measure the temperature directly in the nest 4 1 7 User Interface According to the requirements the user interface is designed to be realized by two hard ware interfaces Ethernet a wired network and WiFi a wireless network All needed controllers are implemented on the SQM4 VF6 W module In case of E
101. uch simpler and probably cheaper equipment was used in a research of nest pre dation of Superb Fairy wren Malurus cyaneus 4 The recording system was based on an Apple MacMini computer controlling and storing data from four waterproof video cameras Eye Spy World with 1 4 inch Sony CCD sensor Each camera was powered by a small 12 V 12 Ah battery and connected to the recording system by a cable The system was set to record continuously To reduce the amount of data the au thors scanned 24 hours of one day only for variation in feeding activity during the day as the highest predation risk is during feeding According to that measure they se lected 2 hour period in the morning and 2 hour period in the evening to be examined thoroughly in all records the rest was ignored 3 3 Event based Recording Recording systems equipped with event detectors help to automatically separate the in teresting data from the rest simplifying results evaluation and potentially saving power and storage resources One such system has been developed for monitoring nests of Tengmalm s owl and is described in 5 The authors functional requirements on the system abilities were 1 Observation of movements of the nesting individuals between the nest and the en vironment 2 Monitoring the times spent by an individual outwards the nest and in the nest 3 Identification of the kind and type of prey 4 Observing behaviour of nestlings and distribution of pa
102. ure 28 appmgr stops both instances of ueyerec and powers off both USB channels Stopping the ueyerec processes involves a sequence of IPC messages DEACTIVATE CLOSE QUIT followed by a forced kill of the pro cess if it does not terminate as requested A5 RECORD START operation Figure 29 simply checks that appmgr is ready for recording A5 RECORD FINISH Figure 29 is also trivial it only outputs data received from appmgr sensor data and RFID code to a file More complicated is the A5 RECORD operation Figure 29 It first commands the ueyerec process handling the door camera ueyerecP to record a video sequence of preset parameters duration framerate and then it does the same for the ueyerec process handling the floor camera ueyerec with different parameters The IPC communication hidden behind this command is following appmgr sends a LIVE message with requested duration and frame rate of the video record to be captured ueyerec replies by SUCCESS message appmgr sends a text message with output filenames format ueyerec records the video sequence and replies by SUCCESS message 28 4 2 Software Figure 25 SET READY operation flowchart executed by appmgr Violet blocks represent MCC communication The red block is illustration of corresponding A5 operation appmgr 29 4 Design Figure 26 RECORD operation flowchart executed by appmgr Violet blocks represent MCC communica
103. usually fails to be scanned as it keeps its legs outside of the hole This can be considered the biggest issue found during the analysis The RFID antenna probably needs to be adjusted to improve the result Date Wed Apr 16 21 29 19 2014 RFID NONE Temperature internal 19 25 C Temperature external 255 75 C Ambient light 2 59 6 Experiments Last thing to be evaluated is the power consumption According to the source power voltage measurements recorded in the sensors 20140414 141357 txt file the initial voltage was about 12 75 Volts and the final voltage was only about 12 11 Volts Similar results were reported by the ornithologists Even though both measurements are prob ably pretty inexact the ornithologists used a very cheap voltmeter the battery was surely discharged more then expected as according to the battery manual 12 1 V cor responds to only 25 remaining energy On the other hand the results are influenced by several aspects e The measurements were not very precise e the battery might not had been fully charged at the beginning e the nights were very cold which decreases the battery performance To sum the results of the experiment it verified the system to work correctly au tonomously and reliably providing high quality data useful for further research Besides few trivial issues the negative temperature bug and low video brightness and one issue of low importance lower frame rate than requested
104. vents which are then translated to messages handled by the message loop In the used camera mode Software Trigger mode see Fig ure 32 the considerable events are TRIGGER and FRAME events The TRIGGER event is emitted when the camera is ready for the next frame capture i e when the last frame was already captured and transferred but not preprocessed by the uEye library API Last frame preprocessing generally e g color conversion and new frame cap turing can be done in parallel as both operations run on different hardware When the frame is also preprocessed by the API and is ready for the application processing the FRAME event is triggered The events need to be translated by separate threads to the messages recognized by the main message queue When the corresponding FRAME message is received ueyerec simply stores the captured frame to the file system as an image file as the uEye library under Linux does not provide direct output in a video format e g Audio Video Interleave AVI New frame capture is initiated after the file has been saved since this sequential approach saves memory only one image buffer is needed and prevents the code from potential bugs while providing high enough frame rate for this application 34 4 2 Software FreezeVideo g i E Ext Trigger ly Sensor E Flash Transfer Pre processing API events b Image display CPU API Camera Exposure l Ill Readout EE TRIGGER
105. xpected 6 2 Outdoor Testing Neither tens of hours of indoor testing undertaken nor the indoor experiments described in Section 6 1 can guarantee the full system functionality in the final application with no supervision Besides there was no time to do some longer supervised experiments in the outdoor environment as there was a pressure to already install the system in the field It was decided to skip further testing efforts for these reasons and undergo baptism by fire Since the system never ran for longer then 24 hours the most probable risks of this approach were e The system might crash after some time without recovering hence loosing poten tially unrecorded data e The system might completely drain the battery which might get damaged Obviously the first point would come true for sure if the decision was to do more supervised experiments so the only main risk of the decision was potential battery damage The ornithologists valued their research more than one battery so the de scribed decision was taken It was decided to do first battery replacement after a 4 day run only to at least eliminate the battery damage risk The system configuration was changed slightly The floor camera was set to record only 30 seconds long sequences but with 4 fps frame rate The rest of cameras config 54 6 2 Outdoor Testing Figure 41 First 6 frames captured by the door camera in the prey simulation experiment 55 6 Expe

Download Pdf Manuals

image

Related Search

Related Contents

Sektor/Recon/XC32 Solo Air Service Manual  堆肥の熟度判定器 - 一般財団法人 畜産環境整備機構  MEC 310 - IGSA, SA de CV  A COUV BIZLINE I  Texas SM320F2812-HT User's Manual  Art. 109200/700/800, BORT HerniaFix® Federbruchband mit  Orion LASERMATE 5684 User's Manual  Tipo 4WRPEH 6 - Bosch Rexroth AG  Descargar    

Copyright © All rights reserved.
Failed to retrieve file