• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NPIX-4DI4DO and NetPi-Nodered container issues
#1
Hi Armin,

I've been scouring for solutions in this forum for the past few days and I could not find the issue I am facing.

I currently have an RTE with me, with NPIX DIO expansion and a Keyence retroreflective sensor that is supposed to output 0 or 1 in NetPi Node-Red.

My container configuration is the same as per the github instructions of NetPi Node-Red (mapped /dev/gpiomem, running on privilege mode etc.)

My flow for a start is simple:

1st attempt:
-NPIX Input node to Debug node to see if any value comes out.

The outcome of this flow:
-The Input node status shows (cleared)
-The msg.payload only shows 0 once

From a documentation I read: 
-Any unconnected ports on the DIO module will show 0

2nd attempt:
-Swapped the sensor signal wire from DIN 0 to 1
-Still same result

3rd attempt:
-Read the documentation and this forum and found out that DIN 1 coincides with RPi GPIO 14
-Installed RPi-GPIO nodes from the palette, used the input node and finally mapped the GPIO 14 and connect it to debug node as per 1st attempt. 
-It still shows zero

I have checked that physical connection using a multimeter:
-Shows 24V,  coinciding with the 24V external power supply that I am using to power up NetPi and the retro sensor
-NPIX Expansion slot PWR led shows green

I think Im missing out on something here. Please advice. 

Many thanks! 

Alhammi

[EDIT] Added attachments for better clarity of the issue. Also, this is likely to be a novice issue as this is only the second time that I used NetPi for developments.


Attached Files Thumbnail(s)
               

.txt   NetPiNodeRed_docker_inspect.txt (Size: 13.91 KB / Downloads: 1)
  Reply
#2
Hello Alhammi,

my first question to customers faced with HW problems is always:  are you using netPI's original SD card it was delivered with or are you using any own SD card with own OS like Raspian OS?

Then I have to say that every two to three month I am updating the Node-RED container to the latest Node-RED version. Last change I made last week and updated the Node-RED in the container to version 1.2.2. I cannot exclude at this time, that maybe the new Node-RED version is the root cause of your problem without trying out NPIX-DIO myself with it.

In order to make tests without Node-RED you can use the console function of the portainer Docker Web-UI in the containers overview list

   

Once you are in the console you can use the standard Linux "echo" or "cat" commands to read and write to the GPIOs wihtout using Node-RED

Code:
echo 1 > /sys/class/gpio/gpioxx/value
cat /sys/class/gpio/gpioxx/value
as described here

https://sites.google.com/site/semilleroa...rials/gpio

Since the Node-RED was started an export of the GPIO might not be necessary since Node-RED did that already. So a
Code:
ls /sys/class/gpio/
should list you already the configured GPIOs.

The manual of the NPIX modules you find located here https://www.netiot.com/netpi/industrial-raspberry-pi-3/ to get out which pin is connected to which GPIO.

So first try the manual way.

Thx
Armin
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#3
There is one more question.

I see yout NPIX module is powered well based on the green LED PWR.

What is if you connect the 24V DC for powering the module also to IN1 directly and do not use the sensor during this test. What happens to the GPIO input value in Node-RED or the console using the "cat ..." command then?

Also ... have you ever measured 24V DC coming out of the sensor signal in order to trigger the IN 1 input well ... or at least any voltage between the sensor pin and GND?

Also ... DIO of NPIX are using a CLT3-4B current limiter IC which needs to have all the signals have a common ground COM. Does your sensor that you have connected to the NPIX has the same 0V/GND potential as used for NPIX for the 0V / 24 V combo and are you using the same 24V DC power supply for the sensor?

Here is a copy of the NPIX manual ... The current flow measured and triggering the input is like this

   

So if sensor and NPIX do not have the same GND then no current flow would be possible.
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#4
I checked the current and latest hilschernetpi/node-red compiled 12 days ago with my personal netPI plus NPIX-4DI4DO and it works fine as it should. 

I tested IN0. The result is 

   

The input is coming and going when I am connecting the 24V also to pin IN0 or when remove it.
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#5
(November-16th-2020, 07:20 AM)Armin@netPI Wrote: I checked the current and latest hilschernetpi/node-red compiled 12 days ago with my personal netPI plus NPIX-4DI4DO and it works fine as it should. 

I tested IN0. The result is 



The input is coming and going when I am connecting the 24V also to pin IN0 or when remove it.

Hi Armin, 

Many thanks for your help. Apologies for the late response. 

After a little tinkering with the NetPi, I have gotten the NPIX DIO to work. (:

As per your advice in your earlier reply:

1) To read DIN 1 from terminal
  • The response I receive from DIN 1 with keyence sensor is 0
2) To test the DIN 1 by injecting 24V into the port
  • The Input node responded with 'set', signifying that the DIN 1 is working fine
3) To verify that both NetPi and Keyence sensor are of same GND/0V potential
  • Verified that they do come from the same ground. 
After these three tests were done and DIN still showed 0 on Node-Red, I have resorted to using another photoelectric sensor (Pepperl+Fuch). With this sensor, and the same flow, the sensor data finally came through, narrowing down to the Keyence sensor being the suspect. 

While I am still finding the root cause on the issue with the Keyence sensor, my guesses are that there might be some compatibility issues with that model. Till then, I may need to peruse its data sheet for more clues. 

It is worth to mention that a good colleague of mine suggested the use of relay in between Keyence sensor and NetPi as a workaround as that has worked with a PLC (same issues too; could not read from it). 

Thanks a lot Armin for sharing some insights on troubleshooting the NPIX DIO. 

Cheers, 
Alhammi
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Get host MAC via REST API inside container bschandra 4 284 November-16th-2020, 09:26 AM
Last Post: bschandra
  NIOT-E-NPIX-4DI4DO with netpi-netx container WalterSchaefer 2 247 October-17th-2020, 07:59 PM
Last Post: WalterSchaefer
  NodeRed and EtherCAT Schranz 3 565 September-23rd-2020, 08:01 AM
Last Post: Armin@netPI
  Network issues after upgrading to Stretch + kernel to 5.4 carmel85 2 348 July-28th-2020, 03:04 PM
Last Post: Armin@netPI
  Exporting and importing container images Armin@netPI 3 374 May-20th-2020, 11:24 AM
Last Post: COswald
Exclamation Creating a container Linnerz 6 669 March-6th-2020, 02:47 PM
Last Post: Armin@netPI
  [SOLVED] activate LED1/2 with Node-RED + fieldbus nodes container Christian_Rau 6 584 October-21st-2019, 10:30 AM
Last Post: Armin@netPI
  Cannot start container Magnus 7 682 October-16th-2019, 01:00 PM
Last Post: Armin@netPI
  Generate VLAN interfaces in container FrankJacob 7 456 September-26th-2019, 03:19 PM
Last Post: Armin@netPI
  USB camera issues dcatteeu 9 714 September-16th-2019, 01:54 PM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)