• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Juergen
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 18
    • Best 0
    • Controversial 0
    • Groups 0

    Juergen

    @Juergen

    0
    Reputation
    734
    Profile views
    18
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Juergen Unfollow Follow

    Latest posts made by Juergen

    • L403 Relaygroup 3 not working

      The 403 runs well for 18 months.
      Now I had a problem with the SD-Card.
      So I created a new one using the same Image from unipi dated 2019.
      After reboot i can Access the Groups 1 and 2. The LEDs RUn1 and RUN2 are green.
      But RUN3 is off, not red.

      After that I created a second SD-Card using the newest Image with the result that all RUN-LEDs are off.

      Any ideas?

      Best regards Jürgen

      posted in UniPi Neuron Series
      J
      Juergen
    • RE: evok not working

      Hi Thomas
      I found the reason why the Control Panel does not Show any IO ports.

      The problem is the Internet Explorer, i use Version 11

      With Chrome it works !!!

      Best regards

      Jürgen

      posted in Official EVOK API
      J
      Juergen
    • RE: evok not working

      Hi Thomas

      attached the evok-nginx.conf, which is from your Image, i did no modifications

      server {
      listen 80 default_server;
      server_name _;

      #ssl on;
      #ssl_certificate      /etc/nginx/democert.pem;
      #ssl_certificate_key  /etc/nginx/democert.key;
      
      access_log  /var/log/evok.access.log;
      root /var/www/evok;
      
      location / {
          index index.html;	    
      }
      
      location /ws {
      	proxy_pass http://localhost:8080;
      	proxy_set_header Host $host:$server_port;
      	proxy_http_version 1.1;
      	proxy_set_header Upgrade $http_upgrade;
      	proxy_set_header Connection "upgrade";
      	proxy_buffering off;
      	proxy_cache off;
      	#send_timeout 120;
      	proxy_read_timeout 180;
      	#proxy_set_header X-Real-IP $remote_addr;
      }
      
      location /rest {
      	proxy_pass http://localhost:8080;
      	proxy_set_header Host      $host:$server_port;
      	#proxy_set_header X-Real-IP $remote_addr;
      }
      
      location /json {
      	proxy_pass http://localhost:8080;
      	proxy_set_header Host      $host:$server_port;
      	#proxy_set_header X-Real-IP $remote_addr;
      }
      

      }

      posted in Official EVOK API
      J
      Juergen
    • RE: jsonrpc get digital input

      Hi Thomas,

      now it works without an error.

      I used the the Image from 9. of march.
      You should also modify /usr/local/lib/python2.7/dist-packages/jsonrpclib/jsonrpc.py
      to avoid the error "getitem" I postd 3 days ago.

      1- sudo nano /usr/local/lib/python2.7/dist-packages/jsonrpclib/jsonrpc.py
      2- Press "Strg + w" to search for "return response['result']"
      3- edit
      def _request(self, methodname, params, rpcid=None):
      request = dumps(params, methodname, encoding=self.__encoding, rpcid=rpcid, version=self.__version)
      response = self._run_request(request)
      check_for_errors(response)
      return response['result']

      to

      def _request(self, methodname, params, rpcid=None):
      request = dumps(params, methodname, encoding=self.__encoding,
      rpcid=rpcid, version=self.__version)
      response = self._run_request(request)
      check_for_errors(response)
      if response == None:
      return response
      else:
      return response['result']

      5- Press "Strg + x" to exit
      6- Finish

      Thank you very much

      Jürgen

      posted in Official EVOK API
      J
      Juergen
    • RE: jsonrpc get digital input

      Hi Thomas,

      if I start my program

      import jsonrpclib
      s=jsonrpclib.Server('http://localhost:8080/rpc')
      re="1_01"
      s.relay_set("1_01",0)
      s.relay_get("1_01")
      s.relay_set("1_01",1)
      spstatus=s.input_get_value('1_01')
      print("sp:", spstatus)

      It works, I can set the relay and also read the DI, but I found the following error:

      relay_set
      [I 180314 17:41:14 web:2063] 200 POST /rpc (::1) 4.82ms
      [E 180314 17:41:14 concurrent:129] Future exception was never retrieved: Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1069, in run
      yielded = self.gen.send(value)
      File "/usr/local/lib/python2.7/dist-packages/tornadorpc_evok/base.py", line 195, in post
      self.finish(response_text)
      File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 962, in finish
      raise RuntimeError("finish() called twice")
      RuntimeError: finish() called twice
      relay_set
      [I 180314 17:41:14 web:2063] 200 POST /rpc (::1) 49.89ms
      [E 180314 17:41:14 concurrent:129] Future exception was never retrieved: Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py", line 1069, in run
      yielded = self.gen.send(value)
      File "/usr/local/lib/python2.7/dist-packages/tornadorpc_evok/base.py", line 195, in post
      self.finish(response_text)
      File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 962, in finish
      raise RuntimeError("finish() called twice")
      RuntimeError: finish() called twice
      input_get_value
      [I 180314 17:41:14 web:2063] 200 POST /rpc (::1) 45.27ms

      Maybee this could help you with my other problem

      posted in Official EVOK API
      J
      Juergen
    • RE: evok not working

      Hi Thomas,

      after boot I stopped evok and start it again manually.
      pi@S103-sn291:/opt/evok $ sudo python evok.py
      [I 180314 17:15:28 config:63] eprom: UniPi Neuron S103 version: 1.0 serial: 0x123
      [I 180314 17:15:28 evok:1628] Starting using config file /etc/evok.conf
      [I 180314 17:15:29 config:75] YAML Definition loaded: L20x.yaml, type: 3, definition count 0
      [I 180314 17:15:29 config:75] YAML Definition loaded: M30x.yaml, type: 3, definition count 1
      [I 180314 17:15:29 config:75] YAML Definition loaded: L50x.yaml, type: 3, definition count 2
      [I 180314 17:15:29 config:75] YAML Definition loaded: S10x.yaml, type: 3, definition count 3
      [I 180314 17:15:29 config:75] YAML Definition loaded: xS40.yaml, type: 3, definition count 4
      [I 180314 17:15:29 config:75] YAML Definition loaded: M10x.yaml, type: 3, definition count 5
      [I 180314 17:15:30 config:75] YAML Definition loaded: L30x.yaml, type: 3, definition count 6
      [I 180314 17:15:30 config:75] YAML Definition loaded: M50x.yaml, type: 3, definition count 7
      [I 180314 17:15:30 config:75] YAML Definition loaded: L51x.yaml, type: 3, definition count 8
      [I 180314 17:15:30 config:75] YAML Definition loaded: xS30.yaml, type: 3, definition count 9
      [I 180314 17:15:30 config:75] YAML Definition loaded: M40x.yaml, type: 3, definition count 10
      [I 180314 17:15:31 config:75] YAML Definition loaded: M20x.yaml, type: 3, definition count 11
      [I 180314 17:15:31 config:75] YAML Definition loaded: CUSTOM MODBUS DEVICE.yaml, type: 3, definition count 12
      [I 180314 17:15:31 config:75] YAML Definition loaded: L40x.yaml, type: 3, definition count 13
      [I 180314 17:15:31 config:75] YAML Definition loaded: xS10.yaml, type: 3, definition count 14
      [I 180314 17:15:31 config:75] YAML Definition loaded: xS50.yaml, type: 3, definition count 15
      [I 180314 17:15:31 config:75] YAML Definition loaded: evok-alias.yaml, type: 2, definition count 0
      [I 180314 17:15:31 evok:1692] HTTP server listening on port: 8080
      [I 180314 17:15:31 modbusclient_tornado:122] SPI client started
      [I 180314 17:15:31 neuron:157] Reading SPI boards
      [D 180314 17:15:31 owclient:377] Entering 1wire loop
      [I 180314 17:15:31 neuron:172] No board on SPI 2
      [I 180314 17:15:31 neuron:172] No board on SPI 3

      Then I try to connect with a browser bolded text http://192.168.200.188, the Control Panel is loaded,
      without any Outputs or Inputs as described in my first post.

      But if I try to connect with port 8080: bolded texthttp://192.168.200.188:8080
      I get this message.

      [W 180314 17:15:42 web:2063] 404 GET / (192.168.200.105) 5.97ms

      Which serverprocess is listening to port 8080 ?

      posted in Official EVOK API
      J
      Juergen
    • RE: jsonrpc get digital input

      Ok,

      I use your image

      posted in Official EVOK API
      J
      Juergen
    • RE: jsonrpc get digital input

      Hi Thomas,

      I found the Problem in an old Forum Topic from october 2015.

      With a modification of jsonrpclib.py it works.

      One last question.

      Is it possible for you to create an Image with a full raspian strech and only the lite Version

      Best regards

      Jürgen

      posted in Official EVOK API
      J
      Juergen
    • RE: jsonrpc get digital input

      Hi Thomas,

      that is funny.
      I had tested this with an older Installation based on evok 1.0

      With the new Image it works!

      But if I add
      s.relay_set("1_01",1)
      to my program I get the message:
      Traceback (most recent call last):
      File "jhtest2.py", line 5, in <module>
      s.relay_set("1_01",1)
      File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/jsonrpc.py", line 288, in call
      return self.__send(self.__name, args)
      File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/jsonrpc.py", line 239, in _request
      return response['result']
      TypeError: 'NoneType' object has no attribute 'getitem'

      posted in Official EVOK API
      J
      Juergen
    • RE: jsonrpc get digital input

      Hi Thomas

      atached my code:

      Import jsonrpclib
      s = jsonrpclib.Server('http://localhost:8088/rpc')
      st = Server.input_get_value("1_01")
      print("result :", st)

      My tests where:

      1. start my Programm without loaded Webpage, result is always 0
        2)start Webpage
      2. start program again, result is 0 or 1 depending on DI1 is set or not. Ist working
      3. Close the Webpage while DI1 is set
      4. now result is 1, independed of DI1

      So it looks that the actual state of DI1 is stored

      posted in Official EVOK API
      J
      Juergen