16 16
mindee

NanoPI M4

Recommended Posts

On 10/11/2018 at 4:09 AM, NicoD said:

The undervoltage problem was a bad cable. It's a lot more stable with the original cable.

I replaced the cable with a 0.25m USB Type-A to Type-C cable (a really cheap one), and it turns out that the voltage is much more stable. At full load+2*RTL8153, it's still up at ~4.97V, and multiple RTL8153 works like a charm now.

 

However it seems that multiple RTL8153 behind a hub has some limitations. On the switch I can see traffic coming out on both USB attached ports, but they're only ~1.3Gbps total. When doing all port test (internal GbE+2 RTL8153, peer is 6*82583v configured with LACP), CPU0 is 100% and CPU2 is near 100%. I guess the A53 cores are not capable of handling such load. Anyway, currently the best choice seems to be attaching one additional RTL8153 for networking. It handles 2Gbps traffic in both directions simultaneously.

Share this post


Link to post
Share on other sites

The USB port can keep the board running by supplying power ?

 

I have an external powered USB hard disk connected to my Nanopi-M4. Today, I did something wrong and I cannot connect to the board (as a headless server) through SSH, so I pulled the power cable to power down the board.  However, the board kept running, and the green led kept flashing.  It was powered down when I also unplugged the USB cable.

 

Share this post


Link to post
Share on other sites

 

2 hours ago, edupv said:

so I pulled the power cable to power down the board.  However, the board kept running, and the green led kept flashing.  It was powered down when I also unplugged the USB cable. 


You can power the board with 5V on the gpio`s and on the usb-c. So from the moment there is sufficient power on the 5V it gets powered.
But that a hard drive is powering it seems odd to me. How do you power the HDD? With a split usb cable? Is it in an enlosure?
Maybe soething wrong with the power supply of the enclosure, a broken diode or so???
 

 
 

Share this post


Link to post
Share on other sites
40 minutes ago, NicoD said:

 


How do you power the HDD? With a split usb cable? Is it in an enlosure?
Maybe soething wrong with the power supply of the enclosure, a broken diode or so???
 

 

Actually, it is a raid. https://www.unitek-products.com/product/usb-storage?view=product&id=197. I power it by using a micro-usb cable plugged into the DC IN socket of the enclosure, the other end of the cable plugged into a 5V USB PSU.

 

When the board is off, plugging the usb cable of the raid to the usb port of board (while type-c power supply cable unplugged) will not turn the board on.

However, when the board is powered on with both of the cables plugged in, unplugging the type-c power cable will not turn it off, it is still powered by the usb cable of the raid.

 

Share this post


Link to post
Share on other sites
2 hours ago, edupv said:

 

Actually, it is a raid. https://www.unitek-products.com/product/usb-storage?view=product&id=197. I power it by using a micro-usb cable plugged into the DC IN socket of the enclosure, the other end of the cable plugged into a 5V USB PSU.

 

When the board is off, plugging the usb cable of the raid to the usb port of board (while type-c power supply cable unplugged) will not turn the board on.

However, when the board is powered on with both of the cables plugged in, unplugging the type-c power cable will not turn it off, it is still powered by the usb cable of the raid.

 

That doesn't seem normal to me. I see no reason why there should be power on that output.
I think @TonyMac32 knows more about these things.
Is it normal the voltage is passed thru the i/o output of an hd enclosure?
I can imagine that you could power the enclosure with that usb-c connector. So maybe the 5V there is open both ways? I'm just guessing.

I think it doesn't start the sbc because there's nothing trying to read the hard drive. So it doesn't see it's connected. Once turned on, the sbc communicates with the hd, so it's turned on. And so the 5V is shared too.
I can be completely wrong. The more knowledgeable people will know more.

Share this post


Link to post
Share on other sites

Is armbian include RPi.GPIO package ?

How can I control GPIO?

root:~# python
Python 2.7.13 (default, Sep 26 2018, 18:42:22) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!
>>> 

 

Share this post


Link to post
Share on other sites
3 hours ago, oeydev said:

Is armbian include RPi.GPIO package ?

How can I control GPIO?

 

 

If you are developing applications yourselves, you can consider the following generic gpio libraries :

python : https://github.com/derekstavis/python-sysfs-gpio

golang https://github.com/brian-armstrong/gpio

 

They can be used in all the boards. From one board to another board needs only changing the gpio port numbers. (e.g. Physical pin 7 of gpio header, OrangePi port number is 6, you have to change the port number to 32 for a Nanopi-M4).

 

Share this post


Link to post
Share on other sites
2 hours ago, edupv said:

 

If you are developing applications yourselves, you can consider the following generic gpio libraries :

python : https://github.com/derekstavis/python-sysfs-gpio

golang https://github.com/brian-armstrong/gpio

 

They can be used in all the boards. From one board to another board needs only changing the gpio port numbers. (e.g. Physical pin 7 of gpio header, OrangePi port number is 6, you have to change the port number to 32 for a Nanopi-M4).

 

Thanks!

But how can I know pin number? 

Share this post


Link to post
Share on other sites
On 10/16/2018 at 6:14 PM, oeydev said:

Thanks!

But how can I know pin number? 

 

From here, you can check the pin names http://wiki.friendlyarm.com/wiki/index.php/NanoPi_M4#Diagram.2C_Layout_and_Dimension.

 

I read somewhere, the formula of the port number is (32p + q + r) , where p, q, r are from the pin name  GPIOp_qr.  q is ABCD corresponding to 0123.

For example, the name of pin 7 is GPIO1_A0, the port number is 32 x 1 + 0 + 0 = 32.

 

Sorry, the above formula is incorrect, please read the following 2 posts.

Share this post


Link to post
Share on other sites
On 10/16/2018 at 7:45 PM, edupv said:

 

From here, you can check the pin names http://wiki.friendlyarm.com/wiki/index.php/NanoPi_M4#Diagram.2C_Layout_and_Dimension.

 

I read somewhere, the formula of the port number is (32p + q + r) , where p, q, r are from the pin name  GPIOp_qr.  q is ABCD corresponding to 0123.

For example, the name of pin 7 is GPIO1_A0, the port number is 32 x 1 + 0 + 0 = 32.

 

 

 

I just checked the GPIO port numbers calculated by the above formula by using a led,  only GPIO1_A0/1/3/4 are correct, other pins are all incorrect. Therefore, by the above formula, I know four port numbers only :

PIN#   		Assignment	Port number
====   		==========     	===========
 7		GPIO1_A0		32
11		GPIO1_A1		33
13		GPIO1_A3		35
15		GPIO1_A4		36

 

Share this post


Link to post
Share on other sites

I think the correct formula for the port number is (32p + 8q + r) , where p, q, r are from the pin name  GPIOp_qrq is ABCD corresponding to 0123.

For example, pin# 8, GPIO4_C1, port number = (32x4 + 8x2 + 1) = 145.

 

All the port number of the 40 pins GPIO header with names GPIOp_qr :

PIN#   		Assignment	Port number			PIN#   		Assignment	Port number
====   		==========     	===========			====   		==========     	===========
 7		GPIO1_A0		32			 8		GPIO4_C1		145
11		GPIO1_A1		33			10		GPIO4_C0		144
13		GPIO1_A3		35			12		GPIO1_C2	 	 50
15		GPIO1_A4		36			16		GPIO1_C6	 	 54
								18		GPIO1_C7		 55
								22		GPIO1_D0		 56
								26		GPIO4_C5		149

I tested all the above pins for output mode with a led.

Share this post


Link to post
Share on other sites
27 minutes ago, edupv said:

other pins are all incorrect.

or.. they're used for something else? e.g. 

8	GPIO4_C1/I2C3_SCL(3V)
10	GPIO4_C0/I2C3_SDA(3V)

as long as i2c-3 is active those pins shouldn't do anything as gpio.. check DT to see if things are active.. 

Share this post


Link to post
Share on other sites
14 minutes ago, chwe said:

or.. they're used for something else? e.g. 


8	GPIO4_C1/I2C3_SCL(3V)
10	GPIO4_C0/I2C3_SDA(3V)

as long as i2c-3 is active those pins shouldn't do anything as gpio.. check DT to see if things are active.. 

 

May be yes, I don't know.

Anyway, I have tested all the above mentioned pins for output mode with a led (with a resistor in series, of course). The scripts is attached :

heartbeat.sh

Share this post


Link to post
Share on other sites

Hi guys, I've had good fun with the Orange Pi plus, learnt something about Linux and re-learned some electronics. The limitations of the Orange are now clear - although I've had my money's worth from it. Time for an upgrade and the Nano Pi M4 does the job.

 

It works very well on an A2 rated SD card and 5.2V PSU. Installing packages on Armbian has been successful so far. USB 3 is great on an SBC and I would like to boot from that in the future once someone with better qualifications has solved that. 

 

The only trouble I am having is with sound. Both sound sinks are visible in the desktop app with the sound level bar dancing around as expected. I can see various options in mixer. removing mute on the appropriate channel gets audio (AV socket) but is horribly distorted. Friendly OS gives sound, but in a humorous s.l.ow.e.d... way which also hangs everything else. Turning off sound makes the other apps respond normally. I am used to Armbian now anyway.

 

I think this is a driver problem, but can't find any info or help around (yet). This thread being the closest....

 

Anyone else had issues with AV sound on this board? I don't have an HDMI to try without dabbling round the back of the telly (which is on the wall!). It's also not 1080p and that caused issues on the previous SBC.

Share this post


Link to post
Share on other sites

Sound seems to be a Problem on RK3399 Chips at the Moment. I got the Rockpro and the M4 , HDMI Sound is only working on 2 Channels, SPDIF is not working at all (did work on an early Kernel from ayufan for Rockpro) Sound on GPIO I2S is not working.. I  think there are Driver Problems that are only solved when Rockchip is working on them.

Share this post


Link to post
Share on other sites

I guess it's a question of time then?

 

Bluetooth also doesn't work now I've tried it (to use that for sound). Not investigated or searched much for that yet though. 

Share this post


Link to post
Share on other sites
(edited)

Hi, have a good day!

I've been tested sound on a NanoPcT4 from FiendlyElec, running Armbian, an to get it working, thru armbian-config selected All drivers. Then you need ALSA mixer. The ALSA mixer can get devices on or off. They are in off state by default.

So, from there I disabled HDMI sound, not interested of it by now, an enabled the internal chip, and it works OK. Is this device I'm using to write this, thinking replace my old tower...

I did have problems on a Firefly-rk3399, and when I find a solution, I will put it at your hands, if I can...

Edited by PacoGirona
Notify me....

Share this post


Link to post
Share on other sites
On 10/21/2018 at 2:28 PM, dogshome said:

The only trouble I am having is with sound. Both sound sinks are visible in the desktop app with the sound level bar dancing around as expected. I can see various options in mixer. removing mute on the appropriate channel gets audio (AV socket) but is horribly distorted. Friendly OS gives sound, but in a humorous s.l.ow.e.d... way which also hangs everything else. Turning off sound makes the other apps respond normally. I am used to Armbian now anyway.

 

I think this is a driver problem, but can't find any info or help around (yet). This thread being the closest....

 

Anyone else had issues with AV sound on this board? I don't have an HDMI to try without dabbling round the back of the telly (which is on the wall!). It's also not 1080p and that caused issues on the previous SBC.

Hi. I just tried with a fresh install of Armbian Stretch. Without changing anything sound worked thru the 3.5mm plug. HDMI also works when I turn off the realtek rt5651-codec.
In Armbian Bionic also no problem.

What do you mean with AV sound?

Share this post


Link to post
Share on other sites

Meaning the 3.5mm jack. Thanks for this - I may have a faulty board. Might try another amp though in case it doesn't like mine. The opi and my pc are happy with it, but it is home / kit build class d and there could be some unwanted interaction.

 Ta!

Share this post


Link to post
Share on other sites

Solved!

 

Some software problem..... I tried another amp and lead and no difference. So I opened alsa mixer and started fiddling. I don't know exactly what happened, but my meddling with the M key and enabling everything from left to right and I have clean stereo audio. I tried selecting things individually (or in stereo pairs) with no success. In desperation I just turned everything on in sequence and now it works.

 

Not touching it any more! Didn't know about it or touch it after install I promise :D

 

P.S. Heatpad confirmed as NVG (Not Very Good!). I'm using 2 * 1mm copper spacers, thermal compound and thin fibre washers under the PCB on the mounting points. Two 1mm spacers would put too much bend on the PCB otherwise. A fan is required as the heatsink has a long thermal inertia, but eventually reaches 55C or more. Gelid silent 50mm fan on 5V is almost inaudible and results in ~35C Maximum. A 30mm fan would be enough.

Share this post


Link to post
Share on other sites
1 hour ago, dogshome said:

So I opened alsa mixer and started fiddling. I don't know exactly what happened, but my meddling with the M key and enabling everything from left to right and I have clean stereo audio. I tried selecting things individually (or in stereo pairs) with no success. In desperation I just turned everything on in sequence and now it works.

It doesn't use alsa-mixer in Armbian but pulseaudio instead. There you had to select the right channel.
All Armbian images use pulseaudio. Cheers.

Share this post


Link to post
Share on other sites
8 hours ago, NicoD said:

It doesn't use alsa-mixer in Armbian but pulseaudio instead. There you had to select the right channel.
All Armbian images use pulseaudio. Cheers.

Hey Nico when are yo doing another excellent NanoPi M4 Youtube video?

 

I just order the 2Gb version.

Share this post


Link to post
Share on other sites
3 hours ago, Seasalt said:

Hey Nico when are yo doing another excellent NanoPi M4 Youtube video?

 

I just order the 2Gb version.

Hi. I`m now benchmarking all my sbc`s for a next video. After that I think it`s Video Editing on SBC`s with the M4. I`ve got another board on the way too. So it will take some time. I`ve done some research on gaming on the M4, but it will take some time before it all works well enough.
What would you like to see in a video?
Thank you. Greetings

Share this post


Link to post
Share on other sites
3 hours ago, NicoD said:

What would you like to see in a video?

Ok for me this NanoPi M4 @2GB is goiing to be a Amatuer / HAM radio, low power / solar Powered  Ham Shack always on computer.

 

I will expect it to run my Linux based Software defined Radio software. My main program is GQRX.

 

The biggest issue I usually have is getting sound to work with Linux radio programs.

 

So if you are looking for something to do maybe set yup 5 different programs and see if they can all play sound at the same time. Also see if they can Mic in at the same tiome.

 

If you have a RTL-SDR dongle please try and bench mark GQRX.

 

Seasalt.

Share this post


Link to post
Share on other sites
5 hours ago, Seasalt said:

Ok for me this NanoPi M4 @2GB is goiing to be a Amatuer / HAM radio, low power / solar Powered  Ham Shack always on computer.

 

I will expect it to run my Linux based Software defined Radio software. My main program is GQRX.

 

The biggest issue I usually have is getting sound to work with Linux radio programs.

 

So if you are looking for something to do maybe set yup 5 different programs and see if they can all play sound at the same time. Also see if they can Mic in at the same tiome.

 

If you have a RTL-SDR dongle please try and bench mark GQRX. 

 

Seasalt.

Nice project. Certainly do-able to power it with solar panels. I've got solar panels too, and great power banks that work as UPS. So you can charge while using it.
I think with a 4A 5V solar panel you'd be good(more is ofcourse better). The M4 uses almost nothing when in idle (0.3A). So you don't need that much to run it for 24 hours.

I'm sorry but now I can't test those things. I'm too bussy benchmarking all my sbc's. For the moment I'm not using the M4, already done it. Not much can tip on the performance of the M4. Only the Odroid XU4 and the NanoPC T3+ do better with some tasks.
Good luck with your M4. I hope the software you'll use is available for ARM. I don't know that software.

Greetings.
NicoD

Share this post


Link to post
Share on other sites

Hello

 

Can someone explain me the purpose of the PWR_KEY on the M4/NEO board please?

Even after checking the schema and the PMIC datasheet I still don't fully understand how it works exactly.

 

Does it act as an reset?

Or does it act like a regular power button on a PC, in other words, it tells the OS to properly shutdown, to avoid data corruption.

 

Thank you

Share this post


Link to post
Share on other sites
16 16