• Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    How to read signal using Neuron

    Scheduled Pinned Locked Moved Unipi Neuron
    9 Posts 3 Posters 4.9k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      lgab
      last edited by lgab

      Hi,
      I have a problem with reading signal from my laser sensor using Neuron.

      I can't find a way to get information about signal.
      I have Neuron S10x and connected to it signal from laser sensor.

      I use two alternative connections:

      • one direct connection from laser sensor to RPI GPIO 40 - and this signal I read correctly
      • one connection via Neuron Digital Input 2 - the same signal from the same laser sensor - but this I'm not able to read.

      I tried clear raspbian OS and your image from https://files.unipi.technology/ jessie-2016-12-06.img.
      On both OS I have the same, can read signal from RPI GPIO 40 but can't read any data from Neuron.

      All connections you can see on the attached file:

      • cable read/yellow is direct connection between laser sensor and GPIO 40 on RPI
      • cable blue/brown is the same signal connected to Neuron Digital Input 2 (you can see light on LED on Neuron)

      Could you write me for example python code that I can read signal?
      For RPI GPIO 40 I read it using

      import RPi.GPIO as GPIO
      import time
      GPIO.setmode(GPIO.BCM)
      PIN = 21
      GPIO.setup(PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
      while True:
          if(GPIO.input(PIN) == 1):
              print("No Input signal detected")
              time.sleep(0.1)
          else:
              print("Input signal detected")
      GPIO.cleanup()
      
      Input signal detected
      Input signal detected
      Input signal detected
      Input signal detected
      Input signal detected
      Input signal detected
      Input signal detected
      
      

      Can you show me similar example how to read data from Neuron ?
      Connection details and what I get using evok.py web interface in attached files.
      I would like to know how to read signals without evok, to be sure the problem is not in configuration of it.

      Thank you in advance for your help.

      3_1484733428203_connection_unipi.jpeg 2_1484733428203_i2cdetect.png 1_1484733428203_gpio_readall.png 0_1484733428203_unipi_panel.png

      It is worth to note that on unipi image I see different result of command i2cdetect -y 1
      This is what I see when use your image:
      0_1484735399068_i2cdetect_on_unipi_img.png

      T 1 Reply Last reply
      Reply Quote 0
      • T
        tomas_hora administrators @lgab
        last edited by

        @lgab Hi! Neurons have completely different architecture than UniPi1. It does not use GPIOs for I/Os instead, there are up to three ARM CPUs that communicate with RPi.

        I suggest you to take a clean Raspbian, install the latest development version from GitHub. It will provide you a websocket, rest or json API to the IOs.

        More topics: https://forum.unipi.technology/search?term=neuron evok&in=titlesposts

        1 Reply Last reply
        Reply Quote 0
        • L
          lgab
          last edited by

          You are right, installation from clear raspbian image and master version of evok from git works.

          Can you show me example of python code that I can read that signal without evok.py?
          It could be even fragment of evok code that just read data from selected Digital Input?

          Thank you in advance,

          T 1 Reply Last reply
          Reply Quote 0
          • T
            tomas_hora administrators @lgab
            last edited by

            @lgab There is a TCP Modbus master daemon runnig under evok (already installed with evok) but does not provide 1Wire communication.

            https://github.com/UniPiTechnology/neuron_tcp_modbus_overlay

            Map of all registers/coils can be found here: http://downloads.unipi.technology

            1 Reply Last reply
            Reply Quote 0
            • L
              lgab
              last edited by

              Thank you, now everything is clear.

              Can you just confirm that below link is proper one for my neuron?

              https://files.unipi.technology/index.php/s/zTmrEbQEvifNd6W/download?path=%2FMediakit&files=Neuron_S103_EN.zip

              T 1 Reply Last reply
              Reply Quote 0
              • T
                tomas_hora administrators @lgab
                last edited by

                @lgab Yep, thats it. Some documentation might not be the latest so always check https://files.unipi.technology/index.php/s/zTmrEbQEvifNd6W?path=%2FProducts%2FNeuron%2FDocumentation

                1 Reply Last reply
                Reply Quote 0
                • B
                  Boy Lenssen
                  last edited by

                  @lgab if you want to try with Socket connection, use the URI ws://192.168.1.16:8088/ws

                  Next, if you want to update the DO2_14, you have to send something like this:

                  {"cmd":"set", "dev":"relay", "circuit":"2_14", "value":"1"}
                  or
                  {"cmd":"set", "dev":"relay", "circuit":"2_14", "value":"0"}
                  
                  1 Reply Last reply
                  Reply Quote 0
                  • L
                    lgab
                    last edited by

                    Thank you for all information.

                    I will try read data directly from modbus daemon.

                    B 1 Reply Last reply
                    Reply Quote 0
                    • B
                      Boy Lenssen @lgab
                      last edited by

                      @lgab my reason for using the socket solution is that it pushes changes of the inputs so that I don't need to poll

                      1 Reply Last reply
                      Reply Quote 0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      • First post
                        Last post