47

Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,
Page 2: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

CryptocurrencyMining:EarningVeriumCoinsWithYourODROID December1,2019

Odroid XU4’s, developed by Hardkernel Co. Ltd, are quite popular. SBC systems ingeneralaredesignedtobeverypowerecient,becauseofthistheyareprettygoodatVeriummining.

ProtectYourPrivacy:WhyYouShouldProbablyMakeYourOwnHomeAutomationDevices December1,2019

With all of the hacks, vulnerabilities, data leaks and other disheartening newssurroundingcloudservices,cloudproducts,andbigdatacompanies,youmaywantto

considerputtingintheeorttocreateyourownversionofthesesolutions."Smart"doorbellHaveyoureadtherecentnewsthatthe"smartdoorbell"

MobileWorkstation:UsingAnODROID-N2ToCreateAFull-FeaturedComputingExperience December1,2019

BecauseIsomehowmanagedtolosemyBIOSpasswordandlockmyselfout,Ihadtopart with my old and beloved laptop, the one running Debian, but instead of just

jumpingtothelatestThinkpad,IwantedtoseeifIcouldsomehowmixthosecravingsmentionedabove:a

KVM:FunwithvirtualizationontheODROID-H2 December1,2019

WhenitcomestotheODROID-H2,myusecaseforitistoworkasavirtualizationhost,torunafewtestVMstorunsoftwareon,ortestupgradesofsystemsformycompany(e.g.upgradingfromolderOSversionstonewerversions).Lookingattheforum,I

TheGSpot:Yourgo-todestinationforallthingsthatareAndroidGaming December1,2019

Our longwait is nally over: Google Stadia, this universal game-changing streamingservice, has gone live now! It debuted late November, 2019. As discussed in earlier

articlesfromthiscolumn,onthislaunchdate,GoogleStadiawillONLYbeavailabletosubscribersoftheStadiaFounder’sEdition.Asyoumay

BuildingAnODROID-H2BladeCenter:CreateAMicro-footprintHighPerformanceComputingStation December1,2019

After receiving inspiration from the excellent OpenSCAD H2 Model posted athttps://forum.odroid.com/viewtopic.php?f=172&t=33824, I created a remix of the

fantasticRaspberryBladeCenter tohouse3ODROID-H2units. Imadethe followingchanges to theoriginalproject:MigratedthelestoSolidWorksBuiltanassemblyAlignedthefastenersWidenedthecart

Page 3: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

SurvivingAPowerOutage:Operatinge-CommerceBusinessDuringRegionalPowerOutage December1,2019

Imagineiftheelectricitytoyourbusinesswascuto.Butnotjustyourbusiness--yourcity,yourcountyandyourentireregion!ThatiswhatameriDroidwasfacedwithdueto

PG&E'sPublicSafetyPowerShutothatstartedonSaturday,October26,2019,andlasteduntiltheafternoon

RepairingYourODROID-N2:HowToRecoverFromAnAccidentalShortCircuit December1,2019

In this guide we will show you how to repair Q1 on your ODROID-N2. The originalarticlewastakenfromtheHardkernelwikipage.

CreatingaVisionApplicationInLowPowerSituations:UsingOpenVinoandOpenCVWithTheODROID-C2 December1,2019

ThisarticlewillguideyouonyourjourneyofsettingupanODROID-C2withUbuntu*16.04(LTS),buildingCMake*,OpenCV,andIntel®OpenVINO™toolkit,settingupyour

Intel®NCS2,andrunningafewsamplestomakesureeverythingisreadyforyoutobuildanddeployyourIntel®OpenVINO™

How-ToSetUpABasicNAS:UsingSambaToShareFiles December1,2019

UsingSamba,anyonecanturnanoldtowerorSBCintoaleserver!

Page 4: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

CryptocurrencyMining:EarningVeriumCoinsWithYourODROID December1,2019 ByJoeRondx,wiki.vericoin.info ODROID-XU4,Tutorial

Odroid XU4’s, developed by Hardkernel Co. Ltd, arequitepopular.SBCsystemsingeneralaredesignedtobe very power ecient, because of this they arepretty good at Veriummining. The downside is youneed a lot of them to amass a sizeable amount ofhashes. Theup-front cost of SBC’s canbe very high,buttheirpowerusageisverylow.Remembertotakeinto account all the required extras to make SBC’sfunction (SD cards, power cables/supplies, networkcables,switches,cooling,mountingmechanism,etc…).

For SBCs the mining software usually needs to becompiled for 1wayusing 128MBper thread. 2Manydevices have been tested in terms of their hashrateand it can fairly be stated that the Odroid platformwithitsOctacoreCPUs(Exynos5422big.LITTLE)and2GB LPDDR3 RAM outperforms any other device. BynowHardkernel has even released a special versionoftheoriginalXU4whichiscalledOdroidHC1andisdesigned for clustering. It should be noted that

despite their relative low total hashrate, the rationhashrate per energy is still good. Also, there issoftware out in the community that helps on themaintenanceof large clusters. Formore informationvisit the ocial ODROID websitehttp://www.hardkernel.com.

OptimizedOSImageforVeriumMining

The ODROID Verium Mining Image (by joe_rondx)includesanoptimizedOSwithpreinstalledminerandseveralotherhandy features. It ismade for theXU4line,thatisOdroidXU4,XU4Q,HC1,HC2,MC1.

Page 5: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure1-LoggingintotheoptimizedVeriumminingimage

Performancefeatures:

hugepagesareenabled(thankstobirty&reworm)

MaximalRAMclocking:933MHz

CPUdownclockingofbigcores:1.9GHz(readherewhy2GHzisnotworthit)

Optimaltwominerscongurationforbig.LITTLEcores.

Helperscripts:

Temperaturelogginginverium/cpu_temp.log

Statusoverviewscriptvrmcheck.sh

Filesystemexpansionbyresize.sh

SetuptheImage

1.DownloadtheImagefrom:https://drive.google.com/open?id=1RbXnGUh5fwmfhMQNzefCK75PajyrXjQi

2.Burnitwithoutextractingit(Therealissueisthefollowing:theimageconsistsoftwopartitions,ifyouextractthegzleyouhavetomakesureyouburnbothpartitionsandnotonlythefatpartition).

3.Onrstbootupgiveit5-10minstimeuntilyoushouldbeabletondthedeviceinthenetwork.

4.Loginwithstandardroot/odroidcredentials.

Figure2-FlashingtheVeriumimageusingEtcher

CongurationoftheImage

The rst thing youwant to do is the ImageUpdate.The script to do so is at:https://raw.githubusercontent.com/DJoeDt/verium/master/odroid_image_update.sh. From thecommandlineuse:

$wget

https://raw.githubusercontent.com/DJoeDt/veriu

m/master/odroid_image_update.sh

$chmod+xodroid_image_update.sh

Nowbeforeyouruntheupdatemakesuretokilltheminer,Iuse

$top

$kill

Where,nnnwouldcorrespondtothepidoftheinstanceofthemineronyoursystem.Nowexecute:

./odroid_image_update.sh

Thenedit

$nano/etc/rc.local

Whatitdoesis:

Getandcompilethelatestrewormminer

Addthenewoneminercommandto/etc/rc.local

Updatevrmcheck.sh(notnicebutwell...)

Why itdoes this: It turnedout that thecongurationwithtwominersisbadforacoupleofreasons.Imust

Page 6: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

admit that Iwas just too greedy andonly looking atH/moutput.Thereasonsarethefollowing:

Thelowhashrateofthe1-wayminerreducesthechancetoactuallysubmitasharewhenpoolmining.

Theadditionalminerconnectioncausesalotofworkonthepoolserverside.

Itissimilarlytrueforsolominingalso.

Oh,andoneminerisjusteasiertomaintain,monitor,etc. And of course the update of the rewormminer gives some nice features. I am getting about530H/m.

Personalconguration

Letus startwith the congurationof theminer. Theautostartofthemineriscurrentlydoneintherc.localle.

$nano/etc/rc.local

Attheendyouwillndtwominingcommandswhichyouneedtoadjustforyourpool/solosetup.Actuallyno,aftertheupdateyoushouldjustdeletethosecommandsandusethenewlyaddedOneminercommand.

Inadditiontotheminercongurationyoumightwanttochangethehostnameandpassword:

$nano/etc/hostname

$nano/etc/hosts

$passwd

Youcanalsoexpandthelesystembyusingthescript

$./resize.sh

Rebootbeforegoingon

$reboot

andruntheresizescriptagain

$./resize.sh

Network

Usually the Ethernet Port should just connect viaDHCP.IfyouhaveaWiStickyoushoulduse

$nmtui

XU4&XU4QTipps

Since the image was created on an HC1 you mightwant to check the GPU setting:https://wiki.vericoin.info/index.php?title=Odroid#Downclocking_the_GPU.

UsageandMonitoring

There isasimplestatusscript inthehomedirectory,call

$./vrmcheck.sh

whichprintsoutthecongurationinrc.local,thelast10linesofeachminerlog,CPUfrequencyandthecurrenttemperature.Monitoringbothminersisabitofachallenge,butDerrickEsminerMonitorscripts(https://github.com/derricke/MinerMonitor)orcasanova'sCLImonitor(https://github.com/bezeredi/verium-cli-monitor)supportthecongurationofports(4048&4049inthiscase).1Ialsorecommendminingontwopooltodecentralizethehasrate,keepsomehashesgoingifonepoolisdownandalsoformonitoring.

Donationsuggestion

Withthenewupdateit'smorediculttospreadsmallH/m portions. I won't take the time to rewrite this,basically: if you runa lot ofOdroidswith this imageconsidertohaveonerunningforme,thanksalot!

1.Theimagestartsminingrightaway-forjoe_rondx(nextversionwillincludereworm).Thisisnotmeanttobearipo.Considertohaveafreshlyburnedcardmineforusperhapsonehourasinitialdonation.

2.Ifyouarerunninglessthan10units(XU4,XU4Q,HC1,MC1/4)theinitialdonationisallweareaskingfor.

3.Ifyouarerunning10-19unitsyoumayconsidertohaveonesmallminerrunningonjoe_rondxaddress.

4.Ifyouarerunning20-29unitsyoumayconsidertohaveonemoresmallminerrunningonrewormsaddress.

5.Ifyouarerunning30-39unitsyoumayconsidertoswitchjoessmallminertoabigone.

6.Ifyouarerunning40-49unitsyoumayconsidertoswitchrewormssmallminertoabigone.

7.Ifyouarerunning50+unitspleasealsoconsiderdonatingtotheprojectviaitsdonationpage.

Page 7: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Justication: Individual hasrates may vary, but let'sassume you were getting 450 H/m per unit withoutthisimage.Theimageshouldgiveyou537H/mwhichisanincreaseofnearly20%.10unitsshouldproduce5370H/mwhileonesmallminerdoesabout137H/m-whichisabout2.5%ofthetotalhashrate.Thankyouverymuchforyoursupport!-joe_rondx

OtherOSImages

Letusstartwithspecial imagesbyOdroidGodbirty:Odroid Miner Images(ttps://drive.google.com/drive/folders/0B26cQdlGFXo2S3ViQ3IxaVhfUkk). In particular the newest imagewith enabled hugepages in combination withrewormsminergivesasignicantboostofhashrate.Itwasusedfortheoptimized image.OdroidsOcialImages (https://wiki.odroid.com/odroid-xu4/os_images/linux/start) are of course ve1ry wellmade. The newest Ubuntu Mate 16.04.3 (20171212)which was release after birtys image even hashugepages enabled. But unfortunately it uses too1much RAM. Even more unfortunate is that theUbuntu 16.04.3 (20171213) (MINIMAL, BARE OS)imagedoesnothavehugepagesenabled.Ihaveoncetestedlike6dierentimagesthatareavailablefortheXU4 platform. For the beginning I recommend theDietPi image (https://dietpi.com/#download)2because its included diet-cong tool alreadysupportslotsofthecongurationsyouwanttoset.

TweakingtheOSforMining

Thewholethingasascript(ARMMiner+XU4Setup):Download the shell script at:https://raw.githubusercontent.com/DJoeDt/verium/master/1wayARM_XU4_VeriumMiner_install.sh.

$wget

https://github.com/DJoeDt/verium/raw/master/1w

ayARM_XU4_VeriumMiner_install.sh

$chmod+x1wayARM_XU4_VeriumMiner_install.sh

$./1wayARM_XU4_VeriumMiner_install.sh

Downclocking(yes,down!)theCPU

To prevent throttling due to heat it may actuallyincrease yourhashrate if theCPUdoesnot run at 2GHz(max).Evenifyoucanpreventthrottlingat2GHzit is anyhow not worth it: youmight get 10-15 H/m

morebutitcostsabout2Watts(outof12)togetthislast increase - so it will not pay back, for Detailscheckout the benchmark at:https://www.planet3dnow.de/vbulletin/threads/428622-Odroid-HC1. Install the utility (or use DietPicong)

$sudoapt­getinstallcpufrequtils

useitdirectly

$sudocpufreq­set­c7­u1.9GHz­r

andmakethechangepermanentbycreatingacongle

$sudonano/etc/default/cpufrequtils

withthefollowingsettings

ENABLE="true"

GOVERNOR="performance"

MAX_SPEED=1900000

MIN_SPEED=1900000

NowtheCPUshouldalwaysrunatconstantspeed.Thisalsosavesareasonableamountofpower.

OverclockingtheRAM

Ontheboot-FAT-Partitionedittheboot.ini

$sudonanoboot.ini

Find

ddr_freq

andchangethevalueto933

#DRAMFrequency

#SetstheLPDDR3memoryfrequency

#Supportedvalues:933825728633(MHZ)

setenvddr_freq933

Makesurebeforebootzto

#setDDRfrequency

6dmc$ddr_freq

DownclockingtheGPU

Installthisutility

$sudoapt-getinstallsysfsutils

Thenedit

Page 8: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

$sudonano/etc/sysfs.conf

andinsertthefollowingline

#PutGPUintopowersavemode(=Downclocking

it)

devices/platform/11800000.mali\:/devfreq/11800

000.mali\:/governor=powersave

thenstarttheservice

$sudoservicesysfsutilsstart

Eect:reducedthepowerconsumptionby0.7–0.8W,SOCwillbe1-3°Ccooler.Getinformationonreducingpowerconsumptioninaheadlessscenarioathttps://obihoernchen.net/1340/lower-gpu-clock-of-odroid-xu4-for-headless-servers/Anotherwaymightbe

$sudonano/etc/rc.local

andaddthislinebeforeexit0

$echopowersave>

/sys/devices/platform/11800000.mali\:/devfreq/

11800000.mali\:/governor

SettingupaSwaple

Veriumismemoryintensive,soweincreasetheswaple(oruseDietPicong).

$sudofallocate­l1G/var/swapfile

$sudochmod600/var/swapfile

$sudomkswap/var/swapfile

$sudoswapon/var/swapfile

checkitwith

$free­h

andcongurethatpermanently

$sudoecho"/var/swapfilenoneswapsw00"

>>/etc/fstab

Processes

Further optimization can be done by checking theprocesstree

$pstree­p

anddisable/uninstallstuthatisnotneeded.KILL'EMALL!Ididnotndityetbutifyoucomeacrossads7846removeit.

$modprobe­rads7846

$tee/etc/modprobe.d/blacklist­ads7846.conf

<<<"ads7846"

XU4hardware

The key is to exchange the thermal tape of theheatsink with some good thermal paste, decreasesthe temperature by 10 degrees (C) using the sametesting conditions.Also get theunder-side cooledaswell.Tosaveelectricityyoumayturndownthepowersuppiiesvoltagewithascrewdriver.Checksdcardslotheat.

Optimalbig.LITTLEandMaximalRAMUsage

aka "Getting the last Hash out of your Odroid". TherststepistouseanOSimagethatusesaminimumamount of RAM for the system. To illustrate how tousethebig.LITTLEcoresandmostofthememorywerst have a look at the conguration witheectstocauseminer.

TheGoal

Verium mining is a lot about RAM, so you want tomaximize the memory usage. How does that work?The verium Miner(https://github.com/eectsToCause/veriumMiner)canbecongured touseadierentamountofRAMper thread. So the idea is to use 2 dierent minercompilationsandmakeuseofthe2GBLPDDR3RAM@933MhztheOdroidhas.Plus:dothatwiselytoalsobenet from the big.LITTLE cores of the SamsungExynos5422 Cortex™ ARM Cortex-A15 (2.0Ghz) /Cortex-A7(1.4Ghz)OctacoreCPUs

Technicaldetails

Theminersettingsarecalled1wayor3waywhere

1way=>128MBperminingthread

3way=>384MBperminingthread

The#wayoftheminerisconguredin

$nanoveriumMiner/algo/scrypt.c

Page 9: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Nowyoucancalculatearoundforyourselforjusttrustmethatyouwantthosetwominercongurationsandthenrun

5threads@1way=640MB

3threads@3way=1152MB

1792MBtotalRAM

Thesystemneedssomememory,tooandwiththissettingthereisonlyaround60MBleftfree-butonlyifyouusetheimagelinkedabove(Ihavetested6dierentones,onlythisworkswith-t5&-t3).A2waycompilationmightbeinterestingaswell,butmycompilationtrydidnotwork.

EasyInstallation

I have prepared two scripts on my git repository(https://github.com/DJoeDt/verium - no warrantywhatsoever):

1wayARM_XU4_VeriumM6iner_install.sh

3wayARM_XU4_VeriumMiner_install.sh

whichinstalltheminersinto

~/verium/1wayminer/

~/verium/3wayminer/

Howtorunthem

Havingbothcompilationsathandweneedtomanagethem properly. Besides the threads there are twothingstocongure

#thebig.littlecore

#theAPIPort

bigcores-t3

The big cores shall run the 3 way miner on thestandardport4048withhighpriority

­­cpu­priority4

­­cpu­affinity0x00F0

­b4048

­­api­bind0.0.0.0:4048

thosearetheoptionstobeset.Aboutusingcpu-anity(https://wiki.vericoin.info/index.php?title=Cpu-anity).Thisisthecompletelinefrommy/etc/rc.local

#3way­t3big

/root/verium/3wayminer/cpuminer­o

stratum+tcp://pool­eu.bloxstor.com:3003­u

VEXMki29ycW5vSt3MmdM5iwHqsHux91EMr.Guide­p

GuidePwd­­cpu­priority

4­t3­­cpu­affinity0x00FF­­api­bind

0.0.0.0:4048&

Justcopyitandgiveitatryasdonation .

littlecores-t5

The littlecoreshall run the1waymineronAPIPort4049withlowerpriority

­­cpu­priority1

­b4049

­­api­bind0.0.0.0:4049

whereIjustdon'ttouch--cpu-anityandthustheremaining4little+1bigcoresareused.Thisisthecompletelinefrommy/etc/rc.local

#1way­t5little

/root/verium/1wayminer/cpuminer­o

stratum+tcp://pool­eu.bloxstor.com:3003­u

VEXMki29ycW5vSt3MmdM5iwHqsHux91EMr.Guide­p

GuidePwd­­cpu­priority1­t5­b4049­­api­

bind0.0.0.0:4049&

Monitoring

If youuse theAPIyouneed tocongurebothports.My workaround with birtys <3 webscripts looks likethis: So far I have copied index_monitor.php toindex_monitor4049.php,recongured

defined('API_PORT')||define('API_PORT',

4049);

init,andjustincludeditbyaddingtotheindex.php.Moreinformationonmonitoringcanbefoundhere.

TheResult

SomeremarksbeforewelookatH/m:

1.again:onlytheimagelinkedaboveworkedforme,butnotevenbydefault

2.youstillhavetocreateaswaple(includedinmyscripts)

3.Iliedaboutthelinesinmyrc.local,Iactuallymineontwodierentpools.Decentralizeit!

Page 10: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

HashrateNumbers!!11

Originally I ran birtys miner conguration whichactually is the 1 way conguration. Without any -toption it juststarts8 threadsandwithpoolmining igotanaverageof

395H/m=1way­t8

Thetwominersputoutlike

195H/m=1way­t5

250H/m=3way­t3

Happyadding!

Iwonderhowthisperformswhensolomining?

Updatetorewormminer&hugepages

1way:128MB­>nr_hugepages=65.3way:

384MB­>nr_hugepages=193.6way:768MB­>

nr_hugepages=386.

Congurationofbirtysimage

Setup: birtys hugepages minimal image: [drive]Congurehugepages

$sudonano/etc/sysctl.conf

to

$vm.nr_hugepages=839

Changehost

$nano/etc/hostname

$nano/etc/hosts

anddram_freq=933in

$nano/media/boot/boot.ini

aswellasthepasswordby

$passwd

Rebootbeforegoingon

$reboot

FirewormMinerInstallation

Removeoldminerfrombirtysimage:

$rm­rfveriumMiner

Installnewestminerbyscript:

$wget\

https://github.com/DJoeDt/verium/raw/master/nwayARM_HC1_reworm_install.sh

$chmod+xnwayARM_HC1_fireworm_install.sh

$./nwayARM_HC1_fireworm_install.sh

MinerAutostartConguration

Autostartcong

$nano/etc/rc.local

#VeriumMinerConfiguration

#bigcores

$nice­­10/root/verium/nwayminer/cpuminer

­ostratum+tcp://vrm.n3rd3d.com:3332­u

joe_rondx.1­pjoe

­t3­11­­cpu­affinity0x00F0­­cpu­priority

2

­­api­bind0.0.0.0:4048­­no­color>>

/root/verium/nwayminer/3waymine.log&

$sleep5#delayforhugepagesallocation

#littlecores

$/root/verium/nwayminer/cpuminer

­ostratum+tcp://eu.vrm.mining­pool.ovh:3032­

ujoe_rondx.HC1_1­pjoe

­14­­cpu­affinity­stride1­­cpu­affinity­

oneway­index0­­cpu­priority0

­­api­bind0.0.0.0:4049­b4049­­no­color>>

/root/verium/nwayminer/1waymine.log

Runthe3wayminerrst!!

­t3­1

Firstbecauseitshouldmakemaximaluseofhugepages.Secondlyrunonly1way

­14

where1threadrunswithouthugepages.

Hashrate

=>400+137=537H/[email protected]

PowertotheRig

[email protected] toconsider if youwant topoweryour rig.

Page 11: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Reference

https://wiki.vericoin.info/index.php?title=Odroidhttps://ameridroid.com/products?keywords=aluminumhttps://forum.odroid.com/viewtopic.php?f=93&t=27239

http://www.thinkwiki.org/wiki/How_to_use_cpufrequtils https://wiki.odroid.com/odroid-xu4/os_images/linux/ubuntu_4.14/ubuntu_4.14https://forum.odroid.com/viewtopic.php?f=146&t=28895&sid=873dc51d2cf97257c807b99826f91525

Page 12: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

ProtectYourPrivacy:WhyYouShouldProbablyMakeYourOwnHomeAutomationDevices December1,2019 ByMiguelAlatorre,ameriDroidTechnician Development,ODROID-C2,ODROID-N2,ODROID-XU4

With all of the hacks, vulnerabilities, data leaks andotherdishearteningnewssurroundingcloudservices,cloud products, and big data companies, you maywant to considerputting in the eort to create yourownversionofthesesolutions.

"Smart"doorbellHaveyoureadtherecentnewsthatthe"smartdoorbell"soldbyamajorcompanysendsyourhome'sWiFipassword inplain text throughtheInternet,allowinghackerstopotentiallygainaccesstoyour home network? And how the same companybragging about tracking "Trick-or-treaters" as theywentfromhouse-to-houseonHalloween?

Have you read the news from this summer of apopular "smart lock" that allowed hackers to unlockyourdoorswithoutknowingyourpasscodeorhavingakey?

Figure1-Image:ChaseDardaman,JasonWheeler

From https://techcrunch.com/2019/07/02/smart-home-hub-aws-unlock-doors:

“Dardaman said any hub connected directly to theinternet would be remotely exploitable. Theresearchers foundvesuchvulnerabledevicesusingShodan,asearchengineforpubliclyavailabledevicesand databases.”Have you heard that Alexa, Siri andGoogleAssistantcanbehackedbyalaserfromupto350feetaway?Newsofthisexploitationcanbefound

Page 13: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

here:https://www.vice.com/en_in/article/3kxwvy/alexa-siri-and-google-assistant-can-be-hacked-remotely-with-lasers

Theseareonlythreeexamplesofbigdatacompaniesmishandling the privacy and security of theircustomers. One of the reasons these "big dataproducts" are so often hacked is because big datacompanies are often less concerned about yoursecurity than they are about prots and getting aproductquicklytomarket. Inaddition,theygenerallyhave sold a lot of the products in question, whichmakesthemajuicytargetforhackers.

Figure2-ResourceList

Here are just a few benets to building your ownversionsoftheseproducts:

Youarefreetoexerciseasmuchcreativityandpassionwhendevelopingyourproductsasyou'dlike

You'lllearnnewskillsandsharpenexistingskills

Youcanaddfeaturesthathaven'tbeenoeredbyothersandsuityourparticularneeds

Youcantakeprideincreatingyourownsolutions,andyoucanxyourownstu

Youcango"overboard"withyoursecuritysteps,ifyousodesire,oryoucanrelyon"securitythroughobscurity,"(https://en.wikipedia.org/wiki/Security_through_obscurity)oracombinationofthetwo,somethingwhichmayworkmuchbetterforaone-oproductthanaproductsoldtothousandsormillionsofcustomersbyabigdatacompany

Youcantakeanexistinghow-toprojectfoundonlineandmodifyittoyourpersonalneedsandpreferences,oftenwithlesseortthanstartingfromscratchTherearemanyopensourceprojectsthatcanbeusedasastartingpointforyoursolution.Asopposedtoa"cannedsolution"providedbyabigdatacompany,opensourcesoftwarecanbeauditedbyanyonetoseeifanysecurityorprivacyconcernsexist.

Theoriginalarticlecanbeviewedatthefollowinglink:https://ameridroid.com/blogs/ameriblogs/privacy-why-you-should-probably-make-your-own-home-automation-devices

Page 14: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

MobileWorkstation:UsingAnODROID-N2ToCreateAFull-FeaturedComputingExperience December1,2019 ByPieterjanMontens ODROID-N2,Tutorial

ForsomeyearsIhavebeenlongingfortwothings:

A“Laptop”withahigh-qualitykeyboardandatrackball

AnARM-architecturebased“workstation”tobeproductivewith

Unexpectedly, and because I somehowmanaged tolosemyBIOSpasswordandlockmyselfout, Ihadtopartwithmyoldandbelovedlaptop,theonerunningDebian (I travel with both a Linux and Windowslaptop.No I can’t thinkof a single reason tobringaMacalong).But insteadof just jumping to the latestThinkpad, I wanted to see if I could somehow mixthose cravings mentioned above: a deconstructed“mobile” ARM-based workstation where I couldchoosealltheparts,withoutsolderorduct-tape,justo-the-shelfcomponents.Itwouldbepower-ecient.Itwould adapt to theplaces I’ll beworking at, usingscreens if available, power, etc., so I’d just need totakethecomponentsI’dneedformyjourney.Itwould

be low-budget. So, o I went with a small shoppinglist.

I already knew I’d use my ergonomic keyboard andtrackball,becausethosearemymostprocientinputtools.Ijustneededacomputingunit,ascreen,andabattery. Those last two components were easy tocomeby,Amazonhasplentyofthem:

Astandard13.3"1080ppanelthatsomehowworks,butcan’tchangebrightnessandcontrastiswrong:should’vepickedsomethingbetter.

A25000mAhpowerpackwithUSBand12Voutputs,that’simportant.MineisfromKrisdonia,andunlikethescreen,I’mveryhappywithit.

Choosing an ARM-based computing unit, powerfulenough to “work” with (decent computing andgraphics capabilities) and with a robust storagemedium (i.e.;notmicroSD)wasabitmoredicult: Ialready had plenty of experience on Raspberry Pi’s

Page 15: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

(thiswasbeforethe4cameout,moreonthatbelow)forhomeprojectsandmonitoringsolutions,butknewit would be lacking as a day-to-day work platform.After a small comparison of available alternatives, IwentwiththeODROID-N24GB,mostlybecauseoftherobusteMMCstorage.Asforamorecomplete listofwhatitoers:

BIG.littlearchitecture:“BIG”quadCortex-A73and“little”dualCortex-A53,makingitaheterogeneoushexacore,associatedwith4GBDDR4RAM

adecentMali-G52GPU

eMMCmemory(upto128GB)

Gigabitethernet,HDMI(4k@60hz),4USB3portsand

Comesinanicepackagewithamassivepassivecooler,whichactsassupportforthewholeunit

Installation went like a breeze (Debian Buster with4.9.190-odroidn2-arm64 kernel), and before longmyusual working environment was installed and fullyfunctional. Itworked! Iused it toactuallymakeworkhappen. I’m writing this article on it. It’s hardwareyou’d nd in a smartphone, it’s small, and now I’vepluggedmyperipherals inandeverything isgreat. Italsohappens tominimizemyenvironmental impact,thepowerconsumptionbeingverylimitedcomparedtoastandardlaptop, letalonedesktop(thescreenisthe most power hungry element here, just like inSmartphones).

So,whatdoesitfeelliketoworkonARM?

Well, for starters: Thanks to Debian compiling thewhole distribution for multiple architectures, I haveaccess to almost all of my most wished for tools.Some (proprietary!) software, like Synology’s cloudstation,arenotavailableforARMarchitectures.Slackisn’t available either, but they oer aworkableweb-basedinterface.

Ididn’texperienceanyproblemswithday-to-daytoolssuchasvim,node,npm,thoughDockerisatadslowto build. However, even GIMP and FreeCAD work!Workingonthebatteryisnicetoo,Ididn’treallystressitbutuntilnowInevermanagedtoemptyit.

Occasionally a tab crashes in Firefox. Otherwisebrowsing is a mundane aair, though nothingcomparabletoamean-16GB-i7-machine.Client-heavy

webapplicationsareanothermatterandsometimesabitslow.SwitchingtoChromeforGoogledocshelps,however. It didn’t become my sole and unique“computer” I take with me though… I still carry aThinkpadalongmostofthetime,andtheyturnouttobequitecomplementary.Ijustneedsomemoretimeto set it all upwhen I arrive and to strip it all downwhenIleave.

This, however, won’t be the end of my ARMadventures. There are still some weaknesses that Iwould like to be addressed, for a device like this tofulllallmyneeds.Like,forexample:

Tensofcores.BIG.littleisgreat,justaddmore!

MoreRAM!

Evenbetterstorage(NVMe?)

On-boardqualitynetworking(wi,ethernet,Bluetooth)

2videooutputs

hardware-basedfull-diskencryption:thesethingsareeasytolose,andmaycontainsensitivedata

Let’snot forget thatMicrosoft isexpected to releaseanARM-poweredSurfacehybridsoon: Imayendupworking exclusively on ARM sooner than I thoughtwaspossible.

ButhowdoesitcomparetotheRaspberryPi4?

ShortlyafterIboughttheODROID,theRaspberryPi4came out, completely unannounced, much to thesurprise of virtually everybody. Most readers willprobably want to know how both ARM platformscompare to each other. This short and subjectivecomparison won’t include the advantage ofraspberry’s formidable community, which is mostlywhy I wentwith raspberrywhen beginningmy ARMadventure in the rst place. I will only focus on thespecic use-case I have, but one should not forgetthat both platforms don’t really address the samemarket segment. All-in-all, the technical dierenceswiththeA72-poweredraspberry4aresmall:

WhiletheODROIDA73CPUisacompletelydierentarchitecture,itonlyoerssomeimprovementstotheA72,asdetailedonanandtech:https://www.anandtech.com/show/10347/arm-cortex-a73-artemis-unveiled

Page 16: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

HardKernel’sODROIDhas2extra“little”A53cores,asusedbytheRaspberryPi3(whohas4ofthem).SoyougetlikethecomputingequivalentofaRaspberryPi4andhalfaRasbperryPi3.

BothhaveGigabitethernetandUSB3ports

ODROIDcomeswithit’sownheatsink,whiletheraspberrythrottlesquicklywithoutone

theODROIDMaliG52GPUshouldbeatleasttwiceaspowerfulastheRaspberryPi’svideocore6(850Mhz,6.8Gpix/svs.500Mhz,2.5GPix/s)

TheODROIDonboardchipsetdoesnotincludewiorbluetooth,itneedsalittledongle…that’sashame,

really,becausetheRaspBerry’sincludeboth

While I would have loved the dual micro-HDMIoutputsoftheRaspberryPi4,themicro-SDstorageisjust too unreliable to be considered for day-to-daywork.eMMCis, inmyopinion,thedecisiveargumentinfavoroftheODROID,comparedtotheRaspberryPi4.

The original article can be found athttps://medium.com/@pieterjan_m/reinterpretation-of-the-mobile-workstation-e8dc95d279f9.

Page 17: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

KVM:FunwithvirtualizationontheODROID-H2 December1,2019 ByTobiasSchaaf ODROID-H2,Tutorial

WhenitcomestotheODROID-H2,myusecaseforitis towork as a virtualization host, to run a few testVMstorunsoftwareon,ortestupgradesofsystemsfor my company (e.g. upgrading from older OSversions to newer versions). Looking at the forum, Isee people struggling to get VMware or CitrixHypervisorrunning,mainlyduetounsupportedNICsanothercomponentsoftheboard.Forme,thatwasalwaysalittlepuzzling,asIknowaboutKVM,whichispart of the Linux Kernel and allows for easyvirtualization,andsinceunderregularLinux(Ubuntu,Debian, etc.) NICs and stu work ne, as doesvirtualization without any issue. When I rstmentioned this in the forum, Iwasasked tomakeaguide,sincerarelyanyoneseemstoknowaboutthis.So let’s see what there is to say: rst, let’s explainwhat I’m actually talking about, and what tools andcomponentsIuseforthis.

KVM

KVM is built into the Kernel, and actually means“Kernel-based Virtual Machine” and uses the LinuxKerneltorunVirtualMachines(VMs)onit.Thisallowsyou to runVMsdirectlyunderanyLinuxyou runonyourODROID-H2(oranyotherPCthatrunsLinux).

QEMU

Qemu – Quick Emulator is known as a rather quickandfeaturerichemulatorthatallowsyoutoemulatedierent systems and hardware components. It canbe used in combination with KVM to emulatehardware such as harddrives, CD-ROMdrives,NICs,etc.butsendsthecommandsfromthedevicestotheKVM virtualization layer. It allows for advancedfeaturessuchassnapshotsforVMs.

libvirt

Libvirtisaopen-sourceAPItocongureVMplatformssuch as KVM, Xen, VMWare, or QEMU. The list ofsupported Hypervisors is rather long and evenincludes containers such as LXC.Wewill use it as a

Page 18: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

frontend,bothgraphicallyaswellasonthecommandlinetodothingswithourVMsinKVM.

FirstScenario

NowthatwehavedecidedtouseKVM,let’sseewhatweneedtorunVMsandhowtoinstallbothLinuxandWindowsVMs,aswellashowtocontrol them.Sincewe’re ODROID lovers, we do this of course on ourODROID-H2, but as said before, it will also work onanyotherx86basedPC/ServerthatrunsLinux.KeepthatinmindwhenIrefertotheODROID-H2fromnowon,asitappliestoanyothersystemaswell.

Requirements

ODROID-H2

InstalledOS(DebianorUbuntuforeasystart)

InternetConnection

In this rst scenario, we don’t need much: only anODROID-H2withaninstalledLinuxofyourchoice.AsIfavorDebianforservertasks,IwilluseDebianBusteras my reference OS, but the commands apply toUbuntuaswellandshouldworkthesame.

InstallationandConguration

Let’s just assume you have already installed a Linuxdistribution fully installed with a DesktopEnvironment (DE) and Network Manager and yourdefaultuseriscalled“odroid”.

$sudoaptinstallvirt­manager

$sudoadduserodroidlibvirt

$sudoreboot

Congratulations,you’redoneandcanstartcreatingVMs!Thatwasn’tsohard,wasit?

VirtualMachineManager(virt-manager)

The Virtual Machine Manager (virt-manager) is agraphical interface that you can use to create andcongureyourVMs,createsnapshotsandallkindofotherthings.

Figure1-VirtualMachineManageronDebianBusterMATEDesktop

The Virtual Machine Manager is what you use tocreate,congureandinteractwithyourVMs.Itcanbeused to observe resources such as CPU usage, andother things. I don’t want to go too much into thedetails, let’s just say there’s a lot you candowith it,andyoumightwanttoreaduponsometutorialsfortheadvancedstu.Fornow, let’s keep it simpleandseewhatweneed to create a VM.Creatingour rstVMIstillhaveaDebianStretchnetinstallimagelayingaround,which I’m going to use in this scenario. Youcanmount.isolesdirectlyinVMssimilartoVMwareandotherhypervisors.Thereisonlyonedetailwhichisgoodtoknow:bydefault,virt-managersearchesforallimagesunder/var/lib/libvirt/images.Itusesthisasthedefaultpoolforallimages,bothyourharddrives,aswellasyourISOlesthatyouwanttomount.Youcanaddmore storage if youwant,but fornow, let’skeepthisoneandcopytheDebianStretchimagethatIhaveintothisfoldersothatit’sfounddirectly.Afterthis, let’s just click on the button in the upper leftcorner of our Virtual Machine Manager to create anew VM. It will open a wizard that will guide youthroughtheentireprocess.

Page 19: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure2-SettingupanewVMwithvirt-managerisveryeasy

Figure3-SelectingDebian9netinstallimageasCDROM

Figure4-Ichose2CPUstoshowthatVMscanhandlemultiplecores

Figure5-IonlywantasmalltestVMso8GBisenoughdiskspace

Figure6-GivetheVManameandwe’redone

Figure7-TheVMstartsandbootstheinstallerimageforDebian9

Page 20: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure8-GoingthoughthestandardsetupandinstallMATEDesktop

Figure9-DebianStretchMATEDesktoprunninginaVM

Theentireprocessisrathereasyandstraightforward.Andaswecansee,evenaninstallationofagraphicaldesktopenvironment isquiteeasy, andcanbeusedrather well. Instead, you could also use a pureterminalinstallationandconnecttoyourVMviaSSH.

InstallingaWindowsVM

InstallingWindowsissimilar,butabitdierent.WhileLinux is rather goodat handling virtual systemsandbeingavirtualsystem itself,Windows isnotasgoodwith those things, and while we could install aWindowsmachineprettymuch the sameway aswedidwiththeLinuxsystem,theperformancewouldbenot very good, as Windows does not handlevirtualizationwellenough.For this, it’sbest to installWindows directly with driver support forvirtualization, especially for KVM to get the best

performance out of it. First, we need to downloadsomedrivers.Luckilyforus,theFedoraprojecttakescare ofmost of the stu for us, and we can simplydownload a pre-made image for all the drivers weneed. At https://bit.ly/2s3rAUK, there are severallinksforthestableimagesandthelatestimageswiththedriversneeded,eitherasaCDorevenasaoppydisk imagetodownload. IdownloadedthestableCDimagewhichatthepointofthisarticlewas:virtio-win-0.1.171.iso and placed it in our images folder asexplainedearlier.Next,wecanstartthecreationofanewVMsameaswedidwithLinux,exceptforthelastscreen where we will check the option “Customizecongurationbeforeinstall”.Here,weneedtochangesome hardware settings for the VM. We start byadding new hardware, where “Storage” shouldalready be selected. We change the device type toCDROMdeviceandselectourvirtio imagewhichhasallofthedrivers.

Figure10-Makesuretoselecttocustomizeconguration

Page 21: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure11-AddanewCDROMdevicewithvirtioISO

Next, we need to adjust some existing hardware;namely our network adapter (NIC) and the disk wewanttouse.Bothdevicestendtobeslowonthistypeof Windows virtualization, especially the diskperformance,whichhasbeenanongoingproblemforme for Windows guests under KVM. I encourageanyone that wants to use Windows VMs (server orclient)toreaduponthistopic,andI’mopentootheroptions and suggestions as to how to increaseperformance.

Figure12-NICshouldbeDevicemodel:virtioforbestperformance

Figure13-WithoutVirtIODiskbusthediskspeedmightbeasslowas1MB/sec

The Network adapter should be changed to virtioDevicemodel for best performance. The same goesfor the Disk bus of our virtual harddrive. Underperformance options, you should set Cache mode“none”. This should increase write performance,which is the biggest issue for Windows hosts. Thestorage format qcow2 is the default for VMs, butsomesuggestusing“raw”asaStorageformatinstead.Whilethiscan increaseperformance, italsoremovessome features like snapshots forVMs, somakesureyou don’t need this. Finally, click the button “BeginInstallation” in the upper left corner of thecongurationwindow,andKVMwillstartournewVMandbootstheWindowsCD.

Figure14-Windowsdoesn’tknowhowtohandleVirtIOdisks

Page 22: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure15-InstallingadditionaldriversduringWindowsSetup

Whenyourststart thesetupofWindowsandwanttoselect theharddriveonwhichyouwant to installWindows, you will nd the list is completely empty.ThisisduetothefactthatWindowsdoesn’thaveanydrivers for VirtIO based disk drives. One Windowsfeature heavily used under Windows 95 or 98 butnearly forgotten by now is required to get thingsworking: the installation of additional drivers duringtheWindowsSetup.For this, select thebutton “Loaddrivers” in the lower left corner of the installationwindow and navigate to the CD wemounted in thesecondCDdrive.Navigatetothefolder“viostor”andthen to theOS and architecture youwant to install.Formethiswasw10/amd64asIinstalledWindows10ona64bitboard (theODROID-H2). If yourOS isnotlisted,takeonethatisclosesttoitanditshouldworkanyway. After the driver was installed, the setupfound the harddrive and I could continue to installWindowsasusual.Afterthesetupcompletedandthesystem rebooted, Windows loaded normally butstoppedagainwhenittriedtoconnecttotheInternet.I did not install drivers for the network when Iinstalledthedriversfortheharddrive.Tobehonest,Idon’t know if I could have, and I haven’t tried. Iprobablycouldhaveinstalledallthenecessarydriversrightthenandthere,butit’snotimportantasyoucancontinuewithoutthem,andinstallthedriverslater.

Figure16-AfterinstallingdriversforVirtIOdiskbusWindowsfoundtheHDD

Figure17-Thenetworkwasanafterthoughtforme

Once Windows is up and running, just navigate toyourSystem→DeviceManagerinWindows,andyouwill nd the devices where the drives are missing.Right click them and select update drivers, thennavigatetotheCDwiththevirtiodrivers.Youdonotneedtoselectthecorrectfolderforthedrivers,sinceWindowswillndthemonitsown.

Page 23: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure18-Windowsbootedupjustneevenwithoutnetwork

Figure19-Installingmissingdrivers;justselecttheCDWindowsdoestherest

Figure20-Windowswillaskifit’ssupposetoinstallthedriver

Figure21-InstallingPCIDeviceBalloonDriver

Installingthe“PCIDevice”BalloonDriverissomewhatcontroversial. Some people claim the system runsbetter without, but I will let you decide about that.What it does is ll the RAMwith a pseudo process,and depending on what RAM the Host OS or theGuest OS needs to run applications, it expands orreduces itssize,andwith thatallowseither theHostor the Guest to usemore RAM, depending on theirneeds.At thispointWindows isupandrunning,andshouldbehavelikeanyotherWindowsVM.

Figure22-NowwecanwatchWindowsdoingwhatWindowsdoesbest

You can install additional drivers, though. Spice is agraphical interface to connect to the display of theVM. Rather than using VNC, like other hypervisors,SpiceisusedbydefaultinQEMU.Itisfasterandmoreresponsive than VNC. For Windows there are spice-guest-tools that can improve graphics and otherfeatures on a Windows guest. Think of it like as

Page 24: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

VMWare or VirtualBox guest tools/additions just forQEMU/Spice.Youcandownloadandinstallthemfromhttps://www.spice-space.org/download/binaries/spice-guest-tools/.You can check if it’s installed correctly by checkingyour graphics adapter after the installation of thespice-guest-tools.

Figure23-RedHatQXLcontrolleristhenewGPUdriverforyourVMwithspice-guest-toolsinstalled

ThereisonefeatureIwanttotalkabout,asit’sbeenused in other hypervisors as well: Snapshots. TheVirtual Machine Manager can handle Snapshots ofVMs justne,sameasVMWare,orVirtualBoxoranyotherhypervisorwoulddo.SimplyopentheSnapshotTABinyourVMclickontheplussymbolandcreateasnapshot.

Figure24-CreatinganewSnapshotforourWindowsVM

Figure25-Snapshotdetails-youcanhavemultiplesnapshotsforonemachine

Whilesnapshotsareanicewaytoreverttoapreviousstate,whichmakes itessentialwhenyouwant to tryoutnew things thatmightaect the system (e.g.OSupgrade),pleaseconsider thatsnapshotscanreduceoverall performance as well as highly increase diskusage. Let’s assume you have a VM with two disks:onefortheOSandasecondwithasizeof20GBasadata store. You ll the data disk to its maximum(20GB)andmakeasnapshot.Thenyouexchangetheentiredataonthedatadisk.Ifyoucheckonthehostsystem, where your qcow2 le for the data disk islocated, you will notice that the size of the le hasincreased to approximately 40GB. Although the sizelimitofthediskis20GB,itnowneedsadditional20GBtostorethedierencebetweenthesnapshotandthenew data. Keep this in mind when working withsnapshots,andalso thatsnapshotsshouldonlybeatemporarysolution,notawaytoorganizeorbackupyourdata.

UpNext

In thenext article on this topic, Iwant to talk aboutadvancedfeatures,likesharedstoragepoolsandlivemigration of VMs from one host to another, whichmeans moving a VM while running from one PC toanother PC without interruption. I also want tointroduce“virsh”,which is thecommand line tool forlibvirt, and also show how you can connect to yourvirtualizationhostsfromaremotesystem,sothatyoudon’tneedadesktopinstallationtorunyourVMson.

Page 25: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

TheGSpot:Yourgo-todestinationforallthingsthatareAndroidGaming December1,2019 ByDaveProchnow Android,Gaming,ODROID-C2,ODROID-N2

Our long wait is nally over: Google Stadia, thisuniversalgame-changingstreamingservice,hasgonelivenow!ItdebutedlateNovember,2019.

As discussed in earlier articles from this column, onthislaunchdate,GoogleStadiawillONLYbeavailabletosubscribersoftheStadiaFounder’sEdition.Asyoumay recall, this $129 package includes a controller,ChromecastUltraforTV,3monthsofStadiaProanda“FREE” streamed copy of Destiny 2. If you are notalready a Founder’s Edition subscriber, then youwillhave to wait for three months before you canexperienceStadia.

Figure1-Founder’sEditionsubscribersgetsomehardwarewiththeirpurchase

After the three month Stadia perk for Founder’ssubscribershas lapsed, then regular subscribers canjoin in the game-streaming party. This Stadia Prooptionwillcost$9.99permonth(threemonthsofthisoption are included with the Founder’s Edition

Page 26: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

subscription)PLUSthecostforpurchasinganygames.Nofreelunchhere,yet.

At October’s Made by Google event, there was amentionthata“freetier”wouldbelaunchedin2020.Thisoptionwillincludestereosoundand1080pgamestreaming.ThefreeoptionisinstarkcontrastwiththepreviouslymentionedStadiaProwhichwillfeature4Kgamestreaming,HDRcolor,5.1surroundsoundandone free game per month. Regardless of yoursubscription tier, you will receive at least 60 framespersecond(fps)forgameplayback.

Figure2-TheStadiacontroller

Unfortunately, there were some surprising “details”mentioned at the October event that disappointedmanyoftheStadiafaithful.666

Bundled inside these surprising caveats that caughtsomeStadia followersby surprisewas the limitationonmobiledevicesthatwillbeabletoaccessStadiaatthe timeof launch.OnlyPixel3and3aphones (andpresumably the new Pixel 4 family of smartphones)and Chrome OS tablets (e.g., Pixel Slate, HPChromebook X2, etc.)will have access. Furthermore,theStadia controllerwillonlywork inwirelessmodewithChromecastUltra.Anycomputer,however,witha Google Chrome browser will work with the Stadiacontroller using a wired USB connection and haveaccess toStadia.Additionally,youwillbeable tousethird-party controllers with Chrome on your Stadia-streamingcomputer.

Figure3-MakeyourTVaStadia“play”withChromecastUltra7

As for games, Google had previously stated that 31gameswouldbereadyontheStadialaunchday.Sincethe bulk of these promised titles have already beenreleased, this goal should be attainable (and do notforget two of these 31 titles are reliable DOOMstandards). Luckily, lots of game developerswant tojumpontotheStadiabandwagon,sothislistofgamesis increasing. In fact, both Red Dead Redemption 2andOrcsMust Die 3 should join the Stadia party inMarch2020.

Figure4-AStadiagamesampler;Destiny2:TheCollectionisincludedfreeforFounder’ssubscribers

Is this a bumpy start for Stadia or just a minor,forgettable glitch? According to Stadia chief, RickOsterloh, “Stadia isaiming todeliver thebestgamesever made to just about any screen in your life”.Enoughsaid.

Ifyouarestill confusedaboutallof thisStadiastu,there is a Google-made video athttps://www.youtube.com/watch?v=Pwb6d2wK3Qwthatexplains“howStadiaworks”or,asitsalsoknown,“Stadia101”.

Page 27: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

BuildingAnODROID-H2BladeCenter:CreateAMicro-footprintHighPerformanceComputingStation December1,2019 By@rvalle ODROID-H2,Tinkering

After receiving inspiration from the excellentOpenSCAD H2 Model posted athttps://forum.odroid.com/viewtopic.php?f=172&t=33824, I created a remix of the fantasticRaspberryBladeCentertohouse3ODROID-H2units.Imadethefollowingchangestotheoriginalproject:

MigratedthelestoSolidWorks

Builtanassembly

Alignedthefasteners

Widenedthecartby2mmsothatitwouldremaintinitsplace

MadepillarsforPSMbrassinsertsbybothHeatlokandMinitech

The SolidWorks les are available athttps://www.thingiverse.com/thing:3929164.

Figure1-Foramorerealisticmodel,hereisanassemblyoftheODROID-H2withperipheralsandheat-sinkon

Page 28: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure2-HereisanotherviewoftheassemblyoftheODROID-H2withperipheralsandheat-sinkon

Figure3-Thedesignofthecaddy

Figure4-Thedesignofthecaddy

Figure5-Thedesignofthecaddy

Figure6-Thedesignofthecaddy

Figure7-Therst3Dprint,whichprettymuchworks,butneedsthickerpillars

Figure8-Therst3Dprint,whichprettymuchworks,butneedsthickerpillars

Page 29: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure9-Therst3Dprint,whichprettymuchworks,butneedsthickerpillars

Figure10-Idecidedtomakeanunusualhack,lettingeachaudioconnectorembeditselfintothenextblock

Figure11-Theaudioblockishigherthanthemount,asyoucanseeonthissideview

Figure12-AsockethasbeencreatedonthebaseofthemounttoembedtheaudioconnectorfromthepreviousH2block

Figure13-Hereyoucanseehoweachaudioconnectorembedsinthenextblock,savingspacetoallow8unitsin3Us

Figure14-Onceyouputthemtogether,thebladecenterlookslikethis

Page 30: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure15-AfterreceivingtheRAMandSSD

Figure16-Therstmountprint

Figure17-Therstmountprint

Figure18-Thesecondmountprint,wherethealignmentknobsworkwell,buttheholesneedtobecleanedofplasticforthemtodotheirjobproperly

Figure19-Theentirerackassembled,whereIimplementedapresstsystemsothatthebladesdon'tcomeothemounteasily,withaclickandahelpertabtogetthemout,similartotheEthernetcables

Figure20-Hereisasectiontoseethelocksystemworking

Page 31: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure21-Hereyoucanseehowthecaddyandtabinteract

Figure22-Thenalassemblymountedintoarack,with3ODROID-H2unitsinstalled

RequiredHardware

4xRods,M6x44.5cm(MetalorNylon)

4xM6Nuts

Optional32xM3HeatLokBrassInsertsfromPSMInternationalorsimilar.

Optional32xM3x5mmscrewsforInsertVersion

Optional32xselftappingscrews5-6mmlong(holeis2.5mmwide)

PrintedParts

8xH2Caddy(eitherInsertsorSelftappingversion)Versionwithinsertsrecommended,butrequiresbrassinserts.

8xH2Mountpart(vanilla,presstorpresst&tabversion)recommendedtheonewithtab.

1xEarLeft

1xEarRight

Equipment

8xH2Boards

3Uavailableinarack(smalldepth/networkrackisOK)

PSU

PendingIssues

I have not tested the Self-tapping screws version ofthecaddyThedistributedPSUisnotrackfriendly.

ODROID-H2 Design Feedback For the particular usecase of using the H2 as a rack blade, the followingissueshavebeenfound:

Theaudioconnectorsaretootall,andshouldstaywithinthelimitsoftheotherconnectors

Thepositioningofthepower/resetswitchesisinconvenient,anditwouldbebettertohavetheminthefrontofthecaddy

ThepositioningoftheLEDsisalsoinconvenient

For more information, comments, suggestions, andquestions, please visit the project page athttps://www.thingiverse.com/thing:3929164 or theODROID Forum post athttps://forum.odroid.com/viewtopic.php?t=36780&p=272149.

Page 32: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

SurvivingAPowerOutage:Operatinge-CommerceBusinessDuringRegionalPowerOutage December1,2019 Bywww.ameridroid.com Tutorial

Imagineiftheelectricitytoyourbusinesswascuto.But not just your business -- your city, your countyandyourentire region!That iswhatameriDroidwasfacedwithduetoPG&E'sPublicSafetyPowerShutothatstartedonSaturday,October26,2019,andlasteduntil the afternoon of Wednesday, October 30aectingourwarehouseinNorthernCalifornia.

Figure1

OurChallenge

ameriDroid'sstadidnotwanttodelaytheshippingofpackagestoourcustomers,andalsodidnotwanttohavecustomersconfrontedwithdeadphonelineswhen trying tocall in.Soweknewwecouldnot just

Page 33: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

kickbackinourbeachchairswithtropicaldrinksuntilthepowercamebackon!

Figure2

OurInfrastructure

Because ameriDroid is a single board computer(https://ameridroid.com/collections/single-board-computer) distributor, retailer(https://ameridroid.com/collections/all), andwholesaler(https://ameridroid.com/pages/corporate-orders),we want to be intimately familiar with the productswesell. Inadditiontoresearchandtheory,usingourproducts inthereal-world isoneof thebestwaystodothis.Wedecidedfromthebeginningthatwewouldoperateasmuchaspossibleusingonlytheproductswe sell. We are also committed to minimizing ourimpact on the environment. We do this in severalways:

Wearecompletelypaperlessinouroperationsotherthan:cardboardboxesandpackingmaterialweuseforshipping,thermalshippinglabels,thermalpackingreceipts

Werecycleanyexcesscardboard,paperandpackingmaterialwegetfromothersources

OurshippingstauseAndroidtabletsforthemajorityoftheirworkinthewarehouse

OurwarehouseinfrastructurerunsonARM-basedODROIDSBCs(https://ameridroid.com/collections/odroid)withonelow-powerembeddedIntelsystem(https://ameridroid.com/products/beelink-sii-mini-pc)(forshippingperipheralsthatrunonWindows,likedigitalscalesandaddresslabelprinters)-thisallowsforredundancyandlowpowerrequirements

Figure3

Ourvideosecuritysystemrunsoncustom-designedRaspberryPicameraunitswithanODROID-U3actingasaDVR,whichisanextremelypower-ecientsystem

Figure5

OursitepremisessecuritysystemrunsonanODROID-XU4Qandbattery-poweredwirelessdoorandmotionsensors,againextremelypower-ecient

Ourperipheralstoragefacilityrunsonano-gridsolararray,butistoofarfromourwarehousetoactasapowersupplyforthemainshippinglocation

Page 34: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

We employ Internet connectivity from 3 dierentproviders for redundancy, but only one ended upbeingviableduringtheregionaloutage:

Comcast-Downduetoregionalequipmentfailure

Verizon-Marginallyoperationalwithhighlatencyandabout50%packetlossduetooverloadednetworks

Pacic.netBondedDSL-Fullyoperational

Because our parent company, Respectech(http://respectech.com/), provides our maininfrastructure on industry-standard equipment, wehad to set up a temporary network to allowameriDroid tooperateon thePacic.net connection.Respectech's server rack takes 30A of power tooperate, so it was not feasible to power theseWindows- and CentOS-based servers on our o-gridsolution.ameriDroid'sphonesystemsalsooperateoRespectech'sinfrastructure.Fortunately,ameriDroid'scalls automatically fail-over to our sta's mobilephonesduringanoutage.

OurSolution

Figure6

Onourrstdayofo-gridoperations,weenlistedtheameriBustoprovidepowerwithits4000Wpeakpuresine wave inverter. The ameriBus has limo-styleperimeter seating, so we installed this inverter toallow the ameriBus to act as a portable conferenceroomanddemofacilityforourSBCsolutionsatfairs,conferences,andwhenvisitingourwest-coastclients.It also came in handy for our unexpected o-gridrequirements.Althoughthissystemworkedperfectly

well,theameriBusconsumedaboutonegallonoffuelforevery4hoursofidlingduetothebigv10engine.We knewwe could do better. The following day,wetooka1000Wpuresinewaveinverterbeingusedonour peripheral storage facility's solar power systemand connected it to ameriDroid's shipping van. Theshipping van has amuch smaller 6 cylinder engine.Thischangeallowedustooperateonapproximately1gallonoffuelforevery8hoursofoperation.BecauseweoperateonSBCs, tablets,and low-power thermalprinters,1000Wofcurrentwasmorethanenough.Anironic challenge was that even during the day, ourshippingstahadtouseLED-poweredheadlampstowork in the warehouse as the overhead lightingwasn'tabletobepoweredup.

Figure7

TheOutcome

We lost a few hours of standard productivity byhavingtosetupo-gridpowerdistributionsolutionsand building a temporary network for our shippinginfrastructure. Other than that, we were nearly fullyoperational for the extent of the 5-day-long PublicSafety Power Shuto event, and most customerorders went out on schedule. The few that didn'tmaketheshippingcut-owentouttheverynextday.We'll beevenmoreprepared for thenext challenge,thanks to the possibilities provided by single-boardcomputers!

Reference

https://ameridroid.com/blogs/ameriblogs/news-operating-e-commerce-business-during-regional-power-outage

Page 35: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

RepairingYourODROID-N2:HowToRecoverFromAnAccidentalShortCircuit December1,2019 ByJustinLee ODROID-N2,Tinkering

In this guidewewill show you how to repairQ1 onyourODROID-N2.Theoriginalarticlewastakenfromthe Hardkernel wiki page available here:https://wiki.odroid.com/odroid-n2/hardware/repairs

Figure1-DiscreteLoadSwitchSchematicwithFTK3407

CausesofQ1TransistorFailure

Over-currents, even for a short duration, can causeprogressive damage to a MOSFET, often with little

noticeable temperature rise before failure.MOSFETsoften carry a high peak-current rating, but theseratings typically assume peak currents only lasting300 µsec or so. And cumulative over-current maycausedamage.

The causes of Q1 failure are generally from built-incurrent limiting circuits in integratedpower switchestoprevent the loadSWfrombeingdestroyedduringover-currents. In the case of discrete load SW, thecurrentlimitingcircuit isnotbuilt in,sotheP-CHFETFTK3407 is damaged due to over-currents as shownabove.

WhentheeMMCismountedtoreverse,over-currentowstoVCC3V3duetotheFLASH_1V8nodeshortcircuittoGND.

GPIOconnectionerrororGPIOshort-circuitonthe40-pinIOport.

Failuretofunction--duetofailure

Page 36: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Asshownbelow,theloadswitchdoesnotsupplytheVCC3V3nodeduetodamageanditspowersupplyisnotsupplied,sobootingtotheeMMC,USB,EthernetandIOpinetc.doesnotwork.

Figure2-BlockdiagramofMOSFETthatisdamaged

Repairprocedure

Note:

YoucanalsoreplaceAO3407AalternativelysinceFTK3470isnoteasilyaccessible.

MakesuretoleavethecomponentsR44,R45,andC147nearbyQ1alone.Smallpartscouldgoyingbyyourwaywardsolderingiron.

Step1.Basically,youcouldseetheQ1damagedbyitsappearanceasshowningure3.

Figure3-Q1outlinedinred

Step 2. To easily detach Q1, you should add a littlesolderonthepadofQ1.

Figure4-SolderaddedtoQ1foreasierremoval

Step 3. If you have a spare soldering iron, use it asshown in the image. If you don't have a sparesoldering iron, it will be harder than using a singlesolderingiron,butyoucouldtrymeltingsolderonthethreepadsatthesametimeandthenpullpartout.

Page 37: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure5-Using2solderingironstoremoveQ1,heatingallofthepadsatthesametime

Figure6-Q1removed

Step4.Removetherestofthesolderonthepad.Useasolderwickforsolderremoval.

Page 38: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure7-Copperwickusedtoremoveanyresidualsolder

Figure8-Solderremoved

Step5.UseSMDtweezersandsolderingthenewQ1intoplace.

Page 39: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

Figure9-NewMOSFETheldinplacewithtweezers Figure10-NewMOSFETsolderinplace

Conclusion

We hope that this guide helped you with repairingyourODROID-N2.AfterreplacingQ1(P-CHFET),yourUSB,Ethernet,ExpansionConnector3.3Vpower,andeMMCbootingshouldworkperfectly.

Page 40: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

CreatingaVisionApplicationInLowPowerSituations:UsingOpenVinoandOpenCVWithTheODROID-C2 December1,2019 Bysoftware.intel.com Linux,ODROID-C2,Tutorial

TheIntel®DistributionoftheOpenVINO™toolkitandtheIntel®NeuralComputeStick2(Intel®NCS2)aretheperfectcomplementforvisionapplicationsinlow-power development environments. Getting setup onso many dierent architectures presentsopportunities. ARMl platforms such as ARM64 arebecoming increasingly common for developersbuilding and porting solutions with low-poweredsingle-boardcomputers(SBCs).Thesecanhavewidelyvarying requirements compared to traditional x86computing environments. While the Intel®Distribution of the OpenVINO™ toolkit provides abinary installation for multiple environments,including the popular Raspberry Pi* SBC, the open-sourceversionoftheIntel®OpenVINO™toolkitoersdevelopers the opportunity to build the toolkit andport application(s) for various environments.HARDKERNEL CO., LTD’s ODROID-C2 is amicrocomputer similar to the Raspberry Pi. The

ODROID-C2 is an ARM64 platform with a powerfulquad-core processor and plenty of RAM (2 GB) formultiple applications. This article will guide you onyour journey of setting up an ODROID-C2 withUbuntu* 16.04 (LTS), building CMake*, OpenCV, andIntel®OpenVINO™toolkit,settingupyourIntel®NCS2,andrunningafewsamplestomakesureeverythingis ready for you to build and deploy your Intel®OpenVINO™toolkitapplications.

Page 41: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

NeuralComputeStickPackage

Although, these instructions were written for theODROID-C2*, the steps should be similar for otherARM*64SBCs suchasODROID-XU4as longas yourenvironment is using a 64-bit operating system. Ifyourdeviceusesa32-bitoperatingsystemsupportingat least the ARMv7 instruction set, visit this ARMv7article: https://intel.ly/2DyJjpt. For generalinstructions on building and using the open sourcedistributionoftheOpenVINO™toolkitwiththeIntel®Neural Compute Stick 2 and the original Intel®Movidius™NeuralComputeStickpleasetakealookatthearticleat:https://intel.ly/2P9kQga.

Hardware

Makesurethatyousatisfythefollowingrequirementsbefore beginning. This will ensure that the entireinstallprocessgoessmoothly:

ARMv7SBCsuchastheOrangepiPCPlus

ATLEASTan8GBmicroSDCard.YoumayutilizetheonboardeMMCmoduleifoneisattached,butyouwillneedamicroSDcardtowritetheoperatingsystemtotheboard

Intel®NeuralComputeStick2

EthernetInternetconnectionorcompatiblewirelessnetwork

DedicatedDCPowerAdapter

Keyboard

HDMIMonitor

HDMICable

USBStorageDevice

SeparateWindows*,Ubuntu*,ormacOS*computer(liketheoneyou’reusingrightnow)forwritingtheinstallerimagetodevicewithacompatiblemicroSDcardreader

SettingUpYourBuildEnvironment

Thisguideassumesyouareusing the rootuseranddoes not include sudo in its commands. If you havecreatedanotheruserandare logged inas thatuser,runthesecommandsasroottoinstallthemcorrectly.

Makesureyourdevicesoftwareisuptodate:

$aptupdate&&aptupgrade–y

Someofthetoolkit’sdependenciesdonothaveprebuiltARMv7binariesandneedtobebuiltfromsource–thiscanincreasethebuildtimesignicantlycomparedtootherplatforms.Preparingtobuildthetoolkitrequiresthefollowingsteps:

Installingbuildtools

InstallingCMake*fromsource

InstallingOpenCVfromsource

Cloningthetoolkit

Thesestepsareoutlinedbelow:

InstallingBuildTools

Installbuild-essential:

$aptinstallbuild­essential

ThiswillinstallandsetuptheGNUCandGNUCPlusPluscompilers.Ifeverythingcompletessuccessfully,moveontoinstallCMake*fromsource.

InstallCMake*fromSource

Theopen-sourceversionofIntel®OpenVINO™toolkit(and OpenCV, below) use CMake* as their buildsystem. The version of CMake in the packagerepositoriesforbothUbuntu16.04(LTS)andUbuntu18.04 (LTS) is too out of date for our uses and noocial binary exists for the platform – as such wemust build the tool from source. As of writing, themost recent stable supported version of CMake is3.14.4. To begin, fetch CMake from the Kitware*GitHub* release page, extract it, and enter theextractedfolder:

$wget

https://github.com/Kitware/CMake/releases/down

load/v3.14.4/cmake­3.14.4.tar.gz

Page 42: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

$tarxvzfcmake­3.14.4.tar.gz

$cd~/cmake­3.14.466

Runthebootstrapscripttoinstalladditionaldependenciesandbeginthebuild:

$./bootstrap

$make–j4

$makeinstall

Theinstallstepisoptional,butrecommended.Withoutit,CMakewillrunfromthebuilddirectory.Thenumberofjobsthemakecommandusescanbeadjustedwiththe–jag–itisrecommendedtosetthenumberofjobsatthenumberofcoresonyourplatform.Youcancheckthenumberofcoresonyoursystembyusingthecommandgrep–c^processor/proc/cpuinfo.Beawarethatsettingthenumbertoohighcanleadtomemoryoverrunsandthebuildwillfail.Iftimepermits,itisrecommendedtorun1to2jobs.CMakeisnowfullyinstalled.

InstallOpenCVfromSource

Intel®OpenVINO™toolkitusesthepowerofOpenCVto accelerate vision-based inferencing. While theCMake process for Intel® OpenVINO™ toolkitdownloads OpenCV, if no version is installed forsupported platforms, no specic version exists forARMv7 platforms. As such, we must build OpenCVfrom source. OpenCV requires some additionaldependencies.Installthefollowingfromyourpackagemanager(inthiscase,apt):

git

libgtk2.0-dev

pkg-cong

libavcodec-dev

libavformat-dev

libswscale-dev

Clone the repository from OpenCV GitHub* page,preparethebuildenvironment,andbuild:

$gitclone

https://github.com/opencv/opencv.git

$cdopencv&&mkdirbuild&&cdbuild

$cmake–DCMAKE_BUILD_TYPE=Release–

DCMAKE_INSTALL_PREFIX=/usr/local..

$make–j4

$makeinstall

OpenCVisnowfullyinstalled.

DownloadSourceCodeandInstallDependencies

Theopen-sourceversionofIntel®OpenVINO™toolkitis available through GitHub. The repository folder istitleddldt,forDeepLearningDevelopmentToolkit.

$gitclonehttps://github.com/opencv/dldt.git

Therepositoryalsohassubmodulesthatmustbefetched:

$cd~/dldt/inference­engine

$gitsubmoduleinit

$gitsubmoduleupdate–­recursive

Intel®OpenVINO™toolkithasanumberofbuilddependencies.Theinstall_dependencies.shscriptfetchestheseforyou.TheremustbesomechangesmadetothescripttorunproperlyonARM*platforms.Ifanyissuesarisewhentryingtorunthescript,thenyoumustinstalleachdependency,individually.Forimagesthatshipwithanon-BashPOSIX-Compliantshell,thisscript(asof2019R1.1)includestheuseofthefunctionkeywordandasetofdoublebracketswhichdonotworkfornon-Bashshells.Usingyourfavoritetexteditor,makethefollowingchanges.

OriginalLine8:

functionyes_or_no

Line8Edit:

yes_or_no()

OriginalLine23:

if[[­f/etc/lsb­release]];then

Line23Edit:

if[­f/etc/lsb­release];then

ThescriptalsotriestoinstalltwopackagesthatarenotneededforARM:gcc-multilibandgPlusPlus-multilib.Theyshouldberemovedfromthescript,or

Page 43: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

allotherpackageswillneedtobeinstalledindependently.

Runthescripttoinstall:

$sh./install_dependencies.sh

Ifthescriptnishedsuccessfully,youarereadytobuildthetoolkit.Ifsomethinghasfailedatthispoint,makesurethatyouinstallanylisteddependenciesandtryagain.

Building

The rst step, for beginning the build, is telling thesystemthelocationoftheinstallationofOpenCV.Usethefollowingcommand:

$exportOpenCV_DIR=/usr/local/opencv4

ThetoolkitusesaCMakebuildingsystemtoguideandsimplifythisbuildingprocess.TobuildboththeinferenceengineandtheMYRIADpluginforIntel®NCS2,usethefollowingcommands:

$cd~/dldt/inference­engine

$mkdirbuild&&cdbuild

$6cmake­DCMAKE_BUILD_TYPE=Release

­DENABLE_MKL_DNN=OFF

­DENABLE_CLDNN=OFF

­DENABLE_GNA=OFF

­DENABLE_SSE42=OFF

­DTHREADING=SEQ

..

$make

IfthemakecommandfailsbecauseofanissuewithanOpenCVlibrary,makesurethatyou’vetoldthesystemthelocationofyourinstallationofOpenCV.Ifthebuildcompletesatthispoint,Intel®OpenVINO™toolkitisreadytorun.Thebuildsareplacedin:

/inference­engine/bin/armv7/Release/

VerifyingInstallation

After successfully completing the inference enginebuild, you should verify that everything is set upcorrectly. To verify that the toolkit and Intel®NCS 2worksonyourdevice,completethefollowingsteps:

Runthesampleprogrambenchmark_apptoconrmthatalllibrariesloadcorrectly

Downloadatrainedmodel

Selectaninputfortheneuralnetwork

ConguretheIntel®NCS2Linux*USBdriver

Runbenchmark_appwithselectedmodelandinput.

SamplePrograms:benchmark_app

TheIntel®OpenVINO™toolkitincludessomesampleprogramsthatutilizetheinferenceengineandIntel®NCS2.Oneoftheprogramsisbenchmark_app,atoolforestimatingdeeplearninginferenceperformance.Itcanbefoundin:

~/dldt/inference­engine/bin/intel64/Release6

Runthefollowingcommandinthefoldertotestbenchmark_app:

$./benchmark_app–h

Itshouldprintahelpdialog,describingtheavailableoptionsfortheprogram.

DownloadingaModel

The program needs amodel to pass into the input.ModelsforIntel®OpenVINO™toolkitinIRformatcanbeobtainedby:

UsingtheModelOptimizertoconvertanexistingmodelfromoneofthesupportedframeworksintoIRformatfortheInferenceEngine

UsingtheModelDownloadertooltodownloadalefromtheOpenModelZoo

DownloadtheIRlesdirectlyfromdownload.01.org

For our purposes, downloading the les directly iseasiest.Use the followingcommands tograbanageandgenderrecognitionmodel:

$cd~

$mkdirmodels

$cdmodels

$wget

https://download.01.org/opencv/2019/open_model

_zoo/R1/models_bin/age­gender­recognition­

retail­0013/FP16/age­gender­recognition­

retail­0013.xml

$wget

https://download.01.org/opencv/2019/open_model

_zoo/R1/models_bin/age­gender­recognition­

Page 44: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

retail­0013/FP16/age­gender­recognition­

retail­0013.bin

TheIntel®NCS2requiresmodelsthatareoptimizedforthe16-bitoatingpointformatknownasFP16.Yourmodel,ifitdiersfromtheexample,mayrequireconversionusingtheModelOptimizertoFP16.

InputfortheNeuralNetwork

Thelastrequireditemisinputfortheneuralnetwork.For the model we have downloaded, you need a62x62 image with 3 channels of color. This articleincludes an archive that contains an image that youcanuse,anditisusedintheexamplebelow.CopythearchivetoaUSBStorageDevice,connectthedevicetoyour board, and use the following commands tomount the drive and copy its contents to a foldercalledOpenVINOinyourhomedirectory:

$lsblk

Usethelsblkcommandtolisttheavailableblockdevices,andmakeanoteofyourconnectedUSBdrive.UseitsnameinplaceofsdXinthenextcommand:

$mkdir/media/usb

$mount/dev/sdX/media/usb

$mkdir~/OpenVINO

$cp/media/archive_openvino.tar.gz~/OpenVINO

$tarxvzf~/OpenVINO/archive_openvino.tar.gz

TheOpenVINOfoldershouldnowcontaintwoimages,atextle,andafoldernamedsqueezenet.Notethatthenameofthearchivemaydier–itshouldmatchwhatyouhavedownloadedfromthisarticle.

ConguretheIntel®NCS2Linux*USBDriver

Some udev rules need to be added to allow thesystemtorecognizeIntel®NCS2USBdevices.Insidetheattachedtar.gzlethereisalecalled97-myriad-usbboot.rules_.txt. It should be downloaded to theuser’shomedirectory.Followthecommandsbelowtoaddtherulestoyourdevice:

Ifthecurrentuserisnotamemberoftheusersgroupthen run the following command and reboot yourdevice:

$sudousermod–a–Gusers“$(whoami)”

Whileloggedinasauserintheusersgroup:

$cd~

$cp97­myriad­usbboot.rules_.txt

/etc/udev/rules.d/97­myriad­usbboot.rules

$udevadmcontrol­­reload­rules

$udevadmtrigger

$ldconfig

TheUSBdrivershouldbeinstalledcorrectlynow.IftheIntel®NCS2isnotdetectedwhenrunningdemos,restartyourdeviceandtryagain.

Runningbenchmark_app

When the model is downloaded, an input image isavailable,andtheIntel®NCS2ispluggedintoaUSBport, use the following commands to run thebenchmark_app:

$cd~/dldt/inference­

engine/bin/intel64/Release

$./benchmark_app–I~/president_reagan­

62x62.png–m

~/models/age­gender­recognition­retail­

0013.xml

$–pp./lib–apiasync–dMYRIAD

Thiswillruntheapplicationwiththeselectedoptions.The–dagtellstheprogramwhichdevicetouseforinferencing–MYRIADactivatestheMYRAIDplugin,utilizingtheIntel®NCS2.Afterthecommandsuccessfullyexecutestheterminalwilldisplaystatisticsforinferencing.IftheapplicationransuccessfullyonyourIntel®NCS2,thenIntel®OpenVINO™toolkitandIntel®NCS2aresetupcorrectlyforuseonyourdevice.

InferencingattheEdge

Now that you have conrmed that your ARMv7 issetup andworking with Intel® NCS 2, you can startbuilding and deploying your AI applications or useone of the prebuilt sample applications to test youruse-case. Next, we will try to do a simple imageclassication using SqueezeNetv1.1 and an imagedownloaded to the board. To simplify things theattached archive contains both the image and thenetwork. The SqueezeNetv1.1 network has already

Page 45: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

beenconvertedtoIRformatforusebytheInferenceEngine.

The following command will take the cat.jpg imagethat was included in the archive, use thesqueezenet1.1 network model, load the model withtheMYRIADplugin into the connected Intel®NCS2,and infer the output. As before, the location of thesampleapplicationis:

/inference­engine/bin/armv7/Release/

$./classification_sample–i

~/OpenVINO/cat.jpg–m

~/OpenVINO/squeezenet/squeezenet1.1.xml–d

MYRIAD

Theprogramwilloutputalistofthetop10resultsoftheinferencingandanaverageoftheimagethroughput.

If youhave come this far, then yourdevice is setup,veried, and ready to begin prototyping anddeployingyourownAIapplicationsusingthepowerofIntel®OpenVINO™toolkit.

For more complete information about compileroptimizations, see our Optimization Notice at:https://intel.ly/33FbQUU.

Reference

https://software.intel.com/en-us/articles/ARM64-sbc-and-NCS2

Page 46: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

How-ToSetUpABasicNAS:UsingSambaToShareFiles December1,2019 ByMiguelAlatorre,ameriDroidTechnician Linux,Tutorial

While having a piece of hardware made specicallyforNAS applications is ideal, that doesn’tmean thatit’s impossible tomakeoneoutofanyoldcomputer[or new single-board computer]! Using Samba,anyonecanturnanoldtowerorSBCintoaleserver!

NOTE:WhileaSambaservercanbesetupandrunonWindowsoperating systems, this guidewill focus ontheLinuxOS.

Now boot up your favorite distro of Linux on yourmachineEditor'snote:Incaseyou'recurious,theblogpicture shows an ODROID-XU4 and 2.5" SSD. Installthe latest version of Samba with the followingcommands:

$sudoaptupdate

$sudoaptupgrade

$sudoaptinstallsamba

BeforeconguringSamba,makesurethatthedriveismountedandaccessible.Tomountit,entersudomountDriveMountingPoint,thoughmakesureto

substituteDriveandMountingPointwiththecorrectdriveanddirectoryrespectively.[Somethinglikethis:sudomount/dev/sda1/mnt/extdrive]

NOTE: To nd the correct drive, use the fdisk -lcommand.

Fromhereweneed todive into the smb.confle tosetup the server. Before playing with theconguration, it isagood idea tomakeabackup in-caseanythinggoeswrong.Todoso,enter:

$sudocp/etc/samba/smb.comf

/etc/samba/smb.comf.bak

Nextcomesthefunpart,toeditthe“*.conf”le,useyourfavoritetexteditor,ortype:

$sudonano/etc/samba/smb.conf

Forasimpleserverentersomethingsimilartothefollowingattheendofthele:

Page 47: Home Page | ODROID Magazine - Regional Power Outage · 2019-12-10 · Why You Should Probably Make Your Own Home Automation Devices December 1, 2019 With all of the hacks, vulnerabilities,

[Share]

comment=SharedFiles

path=/path/to/share/destination

writable=yes

guestok=yes

browsable=yes

That’sall,toaccesstheshareonWindows,enter\Samba.Server.IP.Addressintheleexplorersearchbar;formacOS,selectthe“Go”tabandentersmb://Samba.Server.IP.Address[ineithercase,replaceSamba.Server.IP.AddresswiththeIPaddressofyourSambaserver].ForLinux,theprocessmaybedierentfordierentdistributions,thoughyoushouldbeabletoopenthelemanagerandselecta

“ConnecttoRemoteHost”optionandentersmb://Samba.Server.IP.Address.

[Editor's note: Please note that Samba has multiplesecurityoptions, and theabove conguration isabasiccongurationforstoringlesthatdon'tcontainsensitivedata. If you wish to store and access sensitive data,pleasestudySambasecurityinmoredepth.]

The source of this article is available at:https://ameridroid.com/blogs/ameriblogs/how-to-set-up-a-basic-nas-using-sambaFor more productupdatesandhow-to tutorials, followusonYouTube,our ameriDroid blog, Facebook, Twitter andInstagram!