This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
editing ic2 value clears all sensors
#16
Solución al problema del ADS1115 en OpenPlotter 4.2.0: la configuración se corrompe al reiniciar el servicio I2C

 
 
Síntoma
Después de configurar un ADS1115 desde la interfaz gráfica de OpenPlotter I2C y asignar rutas de Signal K (SKkey)
 
ocurren uno o más de los siguientes problemas:
  • La interfaz I2C deja de funcionar correctamente.
  • Los sensores ADS1115 desaparecen o muestran errores.
  • Se pierden configuraciones.
  • El archivo openplotter.conf cambia automáticamente.
 
Solución
1. Hacer una copia de seguridad
sudo cp \
/usr/lib/python3/dist-packages/openplotterI2c/openplotterI2cRead.py \
/usr/lib/python3/dist-packages/openplotterI2c/openplotterI2cRead.py.bak
 
2. Editar el archivo
sudo nano /usr/lib/python3/dist-packages/openplotterI2c/openplotterI2cRead.py
 
Buscar la línea:
conf2.set('I2C', 'sensors', str(i2c_sensors))
 
Justo antes agregar:
for sensor in i2c_sensors:
    if 'data' in i2c_sensors[sensor]:
        for d in i2c_sensors[sensor]['data']:
            if isinstance(d, dict) and 'object' in d:
                del d['object']
 
Debe quedar así:
for sensor in i2c_sensors:
    if 'data' in i2c_sensors[sensor]:
        for d in i2c_sensors[sensor]['data']:
            if isinstance(d, dict) and 'object' in d:
                del d['object']
 
conf2.set('I2C', 'sensors', str(i2c_sensors))
 
Guardar y salir.
 
3. Reiniciar el servicio
sudo systemctl restart openplotter-i2c-read.service
 
4. Verificar
 
grep "object at 0x" ~/.openplotter/openplotter.conf
No debería devolver ningún resultado.
 
5. Agregar los dispositivos 
 
 
Resultado
Después de aplicar el parche:
  • ADS1115 funciona correctamente.
  • Las rutas Signal K pueden configurarse normalmente.
  • La interfaz I2C permanece estable.
  • Los reinicios del servicio no corrompen la configuración.
  • El archivo openplotter.conf permanece limpio.
 
Versiones afectadas
Detectado en:
  • OpenPlotter I2C 4.2.0-stable
  • Raspberry Pi OS Bookworm
  • ADS1115 utilizando integración Signal K
 
Nota final
Este problema fue identificado analizando los cambios automáticos que realizaba openplotter-i2c-read sobre openplotter.conf después de cada reinicio. El origen resultó ser la escritura accidental de objetos Python temporales dentro del archivo de configuración permanente.
 


Attached Files Image(s)
   
Reply


Messages In This Thread
editar el valor ic2 para anuncios1115 borrar todos los sensores - by Pizoton - 2026-06-01, 02:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)