Orange Pi Zero setup, GPIO, UART (C/C++ and nodejs)

แชร์
ฝัง
  • เผยแพร่เมื่อ 6 ต.ค. 2017
  • Orange Pi main site: www.orangepi.org
    Armbian for Orange Pi: www.armbian.com/orange-pi-zero
    Orange Pi Zero on Banggood: goo.gl/aZE9H1
    etcher.io/
    lucsmall.com/2017/01/19/beginn...
    github.com/zhaolei/WiringOP
    stackoverflow.com/questions/4...
    stackoverflow.com/questions/6...
    www.npmjs.com/package/gpio
    www.npmjs.com/package/serialport
    www.iforce2d.net/sketches/oran...
  • บันเทิง

ความคิดเห็น • 109

  • @linuxras
    @linuxras 6 ปีที่แล้ว +10

    This is what I love about this channel, more than just quads and planes rinse repeat. Very informative and refreshing. Thanks

  • @alberthgsm
    @alberthgsm 6 ปีที่แล้ว

    for someone like me, who has struggled for a year to understand all the steps to implement to exploit in C my card (orangePI pc), your tutorial is just wonderful. I finally could the puzzle reconstruct. Thank you

  • @OtusAsio
    @OtusAsio 6 ปีที่แล้ว

    This video will help me a lot as I just received the same orangePi zero few days ago...Thank you very much!!!

  • @jasnyaneko
    @jasnyaneko 6 ปีที่แล้ว +1

    Thanks a lot for all the info! I recently did something similar with a OPi zero. It is very nice to connect a standard 3 dollar USB webcam and stream video or pictures across wifi. This makes an easy videodatalogger for all kinds of unattended processes in your house / garage. You can use Python or C and OpenCV to automatically interpret the video and take actions through GPIO.

  • @bevanmcnaughton5840
    @bevanmcnaughton5840 5 ปีที่แล้ว

    Good info for beginners - picked up some handy tips myself.
    If you can get a wee heatsink then pop it on the CPU, it'll help disperse a few DegC. There is an expansion module for the Orange Pi Zero too for +2 USB, IR & audio/video.

  • @RaadYacu
    @RaadYacu 6 ปีที่แล้ว

    Great video Scott. This video will be handy

  • @helloboris
    @helloboris 5 ปีที่แล้ว

    What a wonderful post. Thank-you.

  • @retroelectrons2
    @retroelectrons2 6 ปีที่แล้ว

    Excellent! Very comprehensive!!

  • @stylesoftware
    @stylesoftware 5 หลายเดือนก่อน

    I like your videos, it's almost exactly what I do day to day with IoT, It's easier to parse the data from the GPS if you use the parse for
    thats built into the serialport library.

  • @bluehornet6752
    @bluehornet6752 6 ปีที่แล้ว +8

    Awesome video--thanks for posting it! I just ordered an OrangePi 2E board, so this video will be very helpful.
    One small point on your "C++" code. It's C. You used gcc to compile it, even though the source files had .cpp extensions. So it's a trivial point, but if you put true object-oriented code in a .cpp file (or a .c file for that matter), then gcc won't know how to deal with it. So to be technically "correct," you could have either just used g++ to compile your code (and it would work if you later added OOP constructs), or just named the file(s) with a .c extension. Your code worked because you basically just wrote C code, and the WiringPi libraries are also in C, but if someone followed your examples and then added C++ code into their source at some point...it would fail.
    Therefore I only mention this in case someone else has an issue down the road. I'm not trying to correct your video--overall, it's excellent and a huge help. So thanks again.

  • @bertrandcouloume2097
    @bertrandcouloume2097 4 ปีที่แล้ว +1

    thank you! it runs ok on my orange pi pc... merci beaucoup.

  • @zyroxiot9417
    @zyroxiot9417 ปีที่แล้ว +2

    2022 and yet a good instruction. Thanks 🇧🇷👍

  • @satoshiborishi6898
    @satoshiborishi6898 ปีที่แล้ว

    Thanks buddy, This helped me a lot

  • @northshorepx
    @northshorepx 5 ปีที่แล้ว

    excellent. just excellent!

  • @Ed19601
    @Ed19601 6 ปีที่แล้ว

    Can also assign an IP number to a specific mac address. Router can do that. No hassle with the PI

  • @mixxx2005
    @mixxx2005 6 ปีที่แล้ว

    Hello, great to see OPi on your channel. I have spend long hours whit these ones.
    You can add screen via TV out. It works kinda okey ;)

    • @mixxx2005
      @mixxx2005 6 ปีที่แล้ว

      you could also use "nmtui" to activate wifi ;)

    • @mixxx2005
      @mixxx2005 6 ปีที่แล้ว

      Also "armbian-config" is available

  • @avejst
    @avejst 6 ปีที่แล้ว

    Thanks for sharing :-)

  • @humbughumbughumbug
    @humbughumbughumbug 6 ปีที่แล้ว +2

    You can set up your router to always give your orange pi the same IP over DHCP.

  • @nickldominator
    @nickldominator 6 ปีที่แล้ว +3

    Watch out for the WiFi on board the OPi Zero. I have one and the chip they use on it is awful, with poor drivers and super dodgy wireless connections. If you plan to put this on the wheelchair rover, I would plug in an external WiFi card. I would use an ALFA USB wireless card. They have amazing plug and play support in Linux, You can put on a larger antenna such as a 9dBi one instead of the 5dBi they typically come with, and you can set the output transmit power to 1W (legal MAX). I would recommend the Alfa AWUSO36NH. Be careful for fakes though. These cards are pretty pricey at about $30 EACH, but they are the best that exist for the most part.
    Love the video and the Channel!

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว +1

      Are you using Armbian?

    • @nickldominator
      @nickldominator 6 ปีที่แล้ว

      Yes I'm using Armbian on all the OPi's I have. If you look on the Armbian page for the OPi Zero and scroll down a bit, you will see this:
      "* Onboard wireless module (XR819) has poor software support so wireless connection issues are expected
      * Onboard wireless module (XR819) is not supported on mainline releases"
      The XR819 isn't a very good WiFi chip and even in just my home I can barely get 2 MBit(1/4 a Megabyte) connection out of it, with half the packets getting dropped. I would get the Alfa and upgrade to the mainline Kernel. Everything will work same as with Legacy, but OFC with security, stability, and memory upgrades. Mainline Armbian just doesn't support the Mali GPU which is fine, as you probably won't be using the VOUT.

    • @R2053
      @R2053 6 ปีที่แล้ว

      yes, the wifi onboard isnt good, but ive had no problems at all otherwise it, armbian has working i2c and spi should be working too.
      i had 4, i broke 2 because of mistakes, but the 2 that are left run very stable, for the 1.4 version of the board or newer the soc temp will display higher then it actually is

  • @jnewb1
    @jnewb1 6 ปีที่แล้ว

    haha i love these! i even made videos about it before. cheap and fun!

  • @williamna5800
    @williamna5800 6 ปีที่แล้ว

    Putty can be compiled on a linux box as well. Great little app.

  • @aklef
    @aklef 6 ปีที่แล้ว

    I'm enjoying OBS's layering your terminal on top of the green work mat. Kinda funny

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว

      I'm recording a section of my screen using ffmpeg
      th-cam.com/video/pvyedg7Wd8E/w-d-xo.html

  • @Elettronica-xt7nm
    @Elettronica-xt7nm 5 ปีที่แล้ว

    Beautiful project, I wanted to ask you if you could use Orange Pi Zero to manage the relays with Blynk

  • @LetsPatrick
    @LetsPatrick 6 ปีที่แล้ว

    plz more... thx 4 vid

  • @junuhunuproductions
    @junuhunuproductions 6 ปีที่แล้ว

    Cool!!!

  • @4funrc11
    @4funrc11 6 ปีที่แล้ว +1

    Not trying to be snarky, but the names (lol!) they give these microcontrollers. Right? Don't get me wrong, they're absolutely terrific! :*)

  •  6 ปีที่แล้ว +1

    Heh I know armbian developer great guy support it if you can... It is quite hard do support badly supported hardware. I had similar job so I know :) By the way red blink led usually connects to Linux heartbeat led trigger.

  • @RagTheNutsOff
    @RagTheNutsOff 6 ปีที่แล้ว +2

    Howdy Chris, would you like a pair of Onion Omega boards? I have a pair here and I'm not likely to ever use them again, Matt

  • @humbughumbughumbug
    @humbughumbughumbug 6 ปีที่แล้ว

    It has a TV out. CVBS. 640*480@16bpp. It can definitely be a desktop.
    It also has SPI for all the amazing SPI LCDs out there.

    • @grumbel45
      @grumbel45 6 ปีที่แล้ว

      While it has a TV-out, the TV-out is not supported by modern kernels. It only works with the legacy branch of Armbian (Linux 3.4.113 kernel, Debian Jessie), but not on the newer 4.14 kernels. To make matters worse, that old 3.4 kernel is incompatible with modern systemd, so you can't easily mix the old kernel with a modern distro. I did manage to get it up to Debian Stretch with the legacy kernel by removing systemd and going sysvinit, but it's rather fiddly. An attempt to go Debian testing failed, as the boot wouldn't go past network manager. Even when TV-out is running it's not all that great, as you don't have OpenGL or video acceleration from what I can tell.

    • @humbughumbughumbug
      @humbughumbughumbug 6 ปีที่แล้ว

      Grumbel hmm. Well I see that it's "not supported" but it still does display on CVBS. There are other userland executables in order to hit the register settings for the rest of the issues that are "unsupported." I forget the GitHub for it, but it's pretty simple code.

    • @humbughumbughumbug
      @humbughumbughumbug 6 ปีที่แล้ว

      Grumbel As for OpenGL and "Video acceleration" who cares? I'm talking about displaying a desktop... Not playing Crysis and watching highly compressed 4k videos. 😂🤣

  • @humbughumbughumbug
    @humbughumbughumbug 6 ปีที่แล้ว

    There are ports of nmap on Windows, osx, *BSD, etc. Not just a Linux thing.

  • @charliebrownau
    @charliebrownau 5 ปีที่แล้ว +1

    is it powered via MICROUSB 5v or OTG ?

  • @dminhhh
    @dminhhh 6 ปีที่แล้ว

    Can you tell me how to make google assistant on this board, please

  • @sisco6943
    @sisco6943 6 ปีที่แล้ว

    Im sure that you know this, and stated the reason somewhere in the vid. You can check the ip address of the pi from your router interface (same place as where you would change the wifi password), instead of going through and checking it from the usb terminal.

    • @sisco6943
      @sisco6943 6 ปีที่แล้ว +1

      o shit i was right, the next 10 seconds after i posted that, you showed that exact method.

  • @josephkreifelsii6596
    @josephkreifelsii6596 6 ปีที่แล้ว

    Orange Pi VS Raspberry Pi for programmable circuitry?

  • @dminhhh
    @dminhhh 6 ปีที่แล้ว

    Can you make a tutorial for orange pi lite, please! I don't know how to use it!

  • @dminhhh
    @dminhhh 6 ปีที่แล้ว

    Can i use it for my IoT project

  • @LukaSauperl
    @LukaSauperl 5 ปีที่แล้ว

    Also if you're using Google Chrome a good SSH client is Secure Shell App - Offered by: Google Secure Shell Developers, it's very nice

  • @crabsodyinblue
    @crabsodyinblue 6 ปีที่แล้ว

    while you're at node, give NodeRed.org a look. it's so much fun

  • @mba2ceo
    @mba2ceo 6 ปีที่แล้ว

    Please do a tutorial to access GPIO in a console c++ (exe)

  • @lars-magnusskog3983
    @lars-magnusskog3983 ปีที่แล้ว

    Another useful tool is arp-scan to find other machines on the network

  • @idontwantachannelimjustcom7745
    @idontwantachannelimjustcom7745 6 ปีที่แล้ว

    Could those grinding hault situations just be thermal throttling issues since they weren't repeatable during the video? Unfortunately the only way to tell would be to see if you can recreate those issues by redoing the process without the fan.

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว

      The grinding halt was only when trying to do a large compiling job, with or without the fan.

  • @MiggyManMike
    @MiggyManMike 6 ปีที่แล้ว

    Make sure you disable root ssh, a lot of distros enable it but it's lazy and insecure!
    For the ip addressing, if your router supports it consider using static leases (that being where a mac/ip address pair are permanently associated), it's the best of both worlds.

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว

      I forgot to mention but I found that after doing that first init of the passwords, if you try to ssh as root there is no response whatsoever. So I think they have it covered.

    • @MiggyManMike
      @MiggyManMike 6 ปีที่แล้ว

      Good good, though actually you should get a password prompt when trying as root, but you should just be denied :)

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว

      Yes, in all other systems I have used it does that. I guess the idea is that the attacker will remain unaware of whether root login is disabled or not - it gives them zero information.

  • @nobeltnium
    @nobeltnium 4 ปีที่แล้ว

    i'm using the orange pi i96. Couldn't make it show up in IDE arduino serial port list. Plugging it into usb and usb otg right now.
    I also heard that the i96 is a shitty one, should i just get another one? I intend to use it with my WN722n for wifi monitoring.

  • @stylesoftware
    @stylesoftware 5 หลายเดือนก่อน

    For headless SBC's I use Advanced IP Scanner, is free, might be windows only... Ha I'm a Chris from NZ also, Auckland here.

  • @ciccio18
    @ciccio18 4 ปีที่แล้ว

    Orange Pi Zero h2 512mb, black screen problem and cpu heat

  • @alphonsebenedict4327
    @alphonsebenedict4327 5 ปีที่แล้ว

    Dear Sir, can you make some more tutorials based on Orange Pi Zero and Python? Thanks

    • @iforce2d
      @iforce2d  5 ปีที่แล้ว

      I know almost nothing about Python, apart from that the syntax enforcement pisses me off :)

  • @wengegong5044
    @wengegong5044 4 ปีที่แล้ว +3

    Hi iforce2d, your video pretty is intriguing and educated, while l am happened be a member of Allwinner who designs SoC like H2+, H3 for the single-board computer, wondering whether you will be interested if we reach out to share more. Currently we are doing something fun on H3.

    • @MoesKeckeEcke
      @MoesKeckeEcke 3 ปีที่แล้ว

      YES Please! Would be truly interresting to See some insight on it :-) especially how to use Sensors, read ds18b20 i2c temperature or interface to an a/d converter

  • @jorenders4002
    @jorenders4002 6 ปีที่แล้ว

    Thkx, for the wlan0 to work i had to fix one more thing
    in the file => /etc/resolvconf/resolv.conf.d/base
    domain home
    search home telenet.be
    nameserver 195.130.130.3
    nameserver 195.130.131.3
    nameserver 2a02:1800:100::43:2
    nameserver 2a02:1800:100::43:1
    and reboot
    otherwise i cannot reach te WAN from my Orange Pi but only LAN.

  • @gzcwnk
    @gzcwnk 4 ปีที่แล้ว

    For NZ I find aliexpress cheaper and more reliable to deal with, ie you get a refund a lot easier if it (rarely) goes bad.

  • @sergioaiello7135
    @sergioaiello7135 5 ปีที่แล้ว

    HI. Has anybody found the cross reference for GPIO15 and 16? BTW I just found every else within wiringPi.h context. Thank you!

    • @iforce2d
      @iforce2d  5 ปีที่แล้ว

      first result on google for "orange pi zero pinout" seems to cover it:
      i.stack.imgur.com/O03j0.jpg
      Or maybe you mean something else?

  • @BALBERChristianC
    @BALBERChristianC ปีที่แล้ว

    Is it possible to use MAX485 on orange pi?

    • @iforce2d
      @iforce2d  ปีที่แล้ว

      iirc that's an RS485 translator that uses UART input/output, so yes, it should be just like how the GPS was used.

  • @orangepi5692
    @orangepi5692 4 ปีที่แล้ว

    Hi! Can I share this video on our social media account?

    • @iforce2d
      @iforce2d  4 ปีที่แล้ว

      Yes, of course :)

    • @orangepi5692
      @orangepi5692 4 ปีที่แล้ว

      @@iforce2d thanks a lot!

  • @squalazzo
    @squalazzo 6 ปีที่แล้ว

    you can setup a full IOT system using Peter Scargill's "The Script", which knows what board you're using and make the needed mods to have a consistent setup everywhere... i collaborate with him to port the script on as many SBC as possible: tech.scargill.net/a-christmas-script/
    all the stuff you used is installed in an unattended way, only few questions asked at the beginning, then you can go to do other stuff and when back the system will be up and running :)

  • @stereojos86
    @stereojos86 6 ปีที่แล้ว

    Is possible install node red?

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว

      I don't know what that is, but a quick google search shows there is a RaspberryPI version. Seems quite likely it would run on this, but might need a few modifications.

  • @JeffriRanger
    @JeffriRanger 5 ปีที่แล้ว

    Is it powerful enough to compile avr gcc code in ubuntu?

    • @iforce2d
      @iforce2d  5 ปีที่แล้ว

      That might be pushing it... I tried to compile something like that and it seemed to just get stuck halfway through. I think the 'power' it's lacking is memory, not really CPU power - if you can get one with lots of RAM it might help.

    • @JeffriRanger
      @JeffriRanger 5 ปีที่แล้ว

      @@iforce2d I see.. how do you think about orange pi pc 2, do you have recommendation for it?

  • @MrFlashgrenade
    @MrFlashgrenade 6 ปีที่แล้ว +1

    Why not just use while(1)?

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว +2

      Why not just use for (;;)?

    • @MrFlashgrenade
      @MrFlashgrenade 6 ปีที่แล้ว

      Because it looks ugly... I am quite sure it is common practice to use while(1) as an infinite loop. Even arduino loop() is defined as while(1).

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว

      It makes no difference in practice though and ugliness is subjective. To be honest I didn't even pay any attention to it when I copied it from the example: github.com/zhaolei/WiringOP/blob/h3/examples/blink.c

  • @eugeneai
    @eugeneai 2 ปีที่แล้ว

    29:00. Real programmer returns 42 from a function, which has the infinite cycle. ;-)

  • @Herp0
    @Herp0 6 ปีที่แล้ว

    I cant find the port? for arduino?

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว +1

      What port? I don't know what you mean.

    • @Herp0
      @Herp0 6 ปีที่แล้ว

      i will not connect to ardunio? at all.

  • @markgreco1962
    @markgreco1962 6 ปีที่แล้ว +1

    How about a super detailed Linux install on an old windows computer. 45 minutes long iforce2d style.

    • @4funrc11
      @4funrc11 6 ปีที่แล้ว

      Mark Greco Um-hum! +1

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว +1

      For most linux desktop distros these days, installation is just a matter of clicking 'next' a few times and entering a name and password to use. If you want to just try Linux for a bit you don't even need to install it, you can just run it off a "live" disk which will boot up without changing anything on your hard drive. You can't really do much though because 'disk' space is limited to how much RAM your computer has (since it can't modify the actual hard drive) and if you run it from a CD when you turn the computer off nothing is saved (if using a USB stick you can save I think). But it's enough to get an idea of how it would run on your computer.
      www.ubuntu.com/download/desktop
      Actually I just tried this now and you don't even need to click next or set any passwords. Just choose "Try Ubuntu" (not install !!!) when it starts up.

    • @4funrc11
      @4funrc11 6 ปีที่แล้ว

      iforce2d Ah-ha! A lot easier than it used to be. Thx! :*)

    • @igrewold
      @igrewold 6 ปีที่แล้ว

      Mark, it ain't a big issue! Just use Etcher and a lightweight Distro (Xubuntu, AntiX, TinyLinux....etc.)
      etcher.io or use free CD/DVD burner apps to burn ISO on CD/DVD, if USB boot never worked...etc.
      antixlinux.com

  • @PeterScargill
    @PeterScargill 6 ปีที่แล้ว

    Orange Pi Zero.... tech.scargill.net/the-orange-pi-zero/ - got "the script" running on it and just about everything works - ( would NOT recommend the WIFI but on an ethernet connector it is just fine - I seem to recall getting both I2c channels working - anyway, it's all in the blog.

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว

      So far the WiFi has been working fine. I gotta say it doesn't seem all that great for signal reception, at least just from looking at that wavemon utility it's down to about 30% through just 5-6 walls and about 25 meters or so. I don't know how that translates into actual usability/bandwidth though, will have to spend some more time doing practical usage.

  • @charliebrownau
    @charliebrownau 5 ปีที่แล้ว

    Check ALIEXPRESS

  • @BuzZ.
    @BuzZ. 6 ปีที่แล้ว

    Mac ? Get a PC

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว

      Mac? Don't recall mentioning that anywhere, but I think you can use the terminal on Mac to do most of this too.

    • @BuzZ.
      @BuzZ. 6 ปีที่แล้ว

      iforce2d I don't like supporting apple, I call it the "don't repair just get a more expensive one because we need all your money and we will not repair you even easier think for under half a price of new one"
      Just kidding but I don't really like apple.

    • @iforce2d
      @iforce2d  6 ปีที่แล้ว

      I'm with you on that.

    • @BuzZ.
      @BuzZ. 6 ปีที่แล้ว

      iforce2d DTW thanks, I have orange pi pc plus and I didn't even figure out how to get in gpio pins work. And now I can use your video. Thanks :)