OpenMarine
[SOLVED] i2c app wont open - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: Bug Reports (https://forum.openmarine.net/forumdisplay.php?fid=4)
+--- Thread: [SOLVED] i2c app wont open (/showthread.php?tid=2470)



[SOLVED] i2c app wont open - stlry - 2020-04-02

Hi,

the i2c app  (2.1.0)  on my system wont open. I'm on Pi 4, tried to open it from Terminal. First Error was "Could not open file /dev/i2c-0...". After adding i2c-0 to the config text, this is gone, but now i still get 

File "/usr/lib/python3/dist-packages/openplotterI2c/openplotterI2c.py", line 222, in readSensors
    if i['pipeElements'][0]['options']['type']=='SignalK':
KeyError: 'type'

There is no entries under [i2c] in openplotter.conf.
Any Ideas how to fix it?

Thanks!


RE: i2c app wont open - Sailoog - 2020-04-03

"After adding i2c-0 to the config text, this is gone"

That error is expected and just informative so remove what you have done in config file to avoid collateral effects.

I think I know what happens, please could you post here the contents of /home/pi/.signalk/settings.json file?


RE: i2c app wont open - stlry - 2020-04-04

(2020-04-03, 11:26 AM)Sailoog Wrote: "After adding i2c-0 to the config text, this is gone"

That error is expected and just informative so remove what you have done in config file to avoid collateral effects.

I think I know what happens, please could you post here the contents of /home/pi/.signalk/settings.json file?

Hi,

here is the settings.json content:


Code:
{
 "mdns": false,
 "pipedProviders": [
   {
     "id": "gpsdProvider",
     "pipeElements": [
       {
         "options": {
           "hostname": "127.0.0.1",
           "port": 2947,
           "providerId": "gpsdProvider"
         },
         "type": "providers/gpsd"
       },
       {
         "optionMappings": [
           {
             "fromAppProperty": "selfId",
             "toOption": "selfId"
           },
           {
             "fromAppProperty": "selfType",
             "toOption": "selfType"
           }
         ],
         "type": "providers/nmea0183-signalk"
       }
     ]
   },
   {
     "enabled": true,
     "id": "st2nmea",
     "pipeElements": [
       {
         "options": {
           "logging": false,
           "subOptions": {
             "baudrate": 38400,
             "device": "/dev/ttyOP_st2nmea",
             "type": "serial",
             "validateChecksum": true,
             "providerId": "st2nmea",
             "toStdout": "nmea0183out"
           },
           "type": "NMEA0183",
           "providerId": "st2nmea"
         },
         "type": "providers/simple"
       }
     ]
   },
   {
     "pipeElements": [
       {
         "type": "providers/simple",
         "options": {
           "logging": false,
           "type": "NMEA0183",
           "subOptions": {
             "validateChecksum": true,
             "type": "udp",
             "port": "10110",
             "sentenceEvent": "ais"
           }
         }
       }
     ],
     "id": "ais",
     "enabled": true
   }
 ],
 "vessel": {
   "brand": "Buchanan",
   "dimensions": {
     "depthTransducer": 0.5,
     "keel": 1.85,
     "length": 11,
     "mast": 15,
     "width": 2.85
   },
   "name": "Nutria",
   "type": "36",
   "uuid": "urn:mrn:signalk:uuid:c0d79334-4e25-4245-8892-54e8ccc8021d"
 },
 "interfaces": {
   "appstore": true,
   "logfiles": true,
   "nmea-tcp": true,
   "plugins": true,
   "providers": true,
   "rest": true,
   "tcp": true,
   "webapps": true,
   "ws": true
 },
 "wsCompression": false,
 "enablePluginLogging": true,
 "pruneContextsMinutes": 60
}



RE: i2c app wont open - Sailoog - 2020-04-05

Thanks strly,

Interesting, it seems that your GPSD connection in Signal K server is causing the crash of i2c app. I will fix this and will send you a test package.

Is this GPSD connection working? that is an old connection that was not ported to the Signal k server GUI, wondering if it would be worth adding a GPSD option in SK GUI. Tkurki?


RE: i2c app wont open - Sailoog - 2020-04-05

Test this package, it should fix your problem:
https://launchpad.net/~sailoog/+archive/ubuntu/openplotter/+files/openplotter-i2c_2.1.1-stable_all.deb
Please report so we can go to production.


RE: i2c app wont open - stlry - 2020-04-05

(2020-04-05, 12:19 PM)Sailoog Wrote: Test this package, it should fix your problem:
https://launchpad.net/~sailoog/+archive/ubuntu/openplotter/+files/openplotter-i2c_2.1.1-stable_all.deb
Please report so we can go to production.


Perfect, works fine! Yes, the gpsd provider is working.
Now, as I wanted to use i2c for the INA219 current sensor: is there a way to add it in the i2c-app?

Thank you!


RE: i2c app wont open - Sailoog - 2020-04-05

OK, thanks!

Adding support for the INA219 is in the TODO list but I do not have neither the sensors nor instruments required to develop this at home/prison. Here in Catalonia there is a total lockdown and I will not be able to go to the lab until April 13 at least Sad

Marking this thread as solved.


RE: [SOLVED] i2c app wont open - Sailoog - 2020-04-08

FYI. GPSD connections have been added to Signal K server 1.27.1. You should replace your manual GPSD connection.