Hi,
I am just starting with ABMaterial to make a Webapp for Raspberry PI to manage some external hardware, I am a c++ programmer so my experience is only doing native apps.
I did some basic testing using a template from ABMaterial and I can manage GPIO pins at will using the jPi4J wrapper library and it works perfect but for I2C or SPI protocols I need to access with calls to the Pi4J java library as Erel explained on some threads:
....
and
What is the right way to access the library from the web app? If I do direct calls from a clicked button, per example, I get an I/O error from java so I suspect that I need some routine or library to pass data between the web app and the native routines running inside the Raspberry .
Thanks for your help.
I am just starting with ABMaterial to make a Webapp for Raspberry PI to manage some external hardware, I am a c++ programmer so my experience is only doing native apps.
I did some basic testing using a template from ABMaterial and I can manage GPIO pins at will using the jPi4J wrapper library and it works perfect but for I2C or SPI protocols I need to access with calls to the Pi4J java library as Erel explained on some threads:
B4X:
factory.InitializeStatic("com.pi4j.io.i2c.I2CFactory").RunMethodJO("getInstance", Array As Object(BusNumber))
and
B4X:
Dim jo As JavaObject
jo.InitializeStatic("com.pi4j.wiringpi.Spi").RunMethod("wiringPiSPISetup", Array As Object(Channel, Speed))
jo.InitializeStatic("com.pi4j.wiringpi.Spi").RunMethod("wiringPiSPIDataRW", Array As Object(Channel, Data, Len))
What is the right way to access the library from the web app? If I do direct calls from a clicked button, per example, I get an I/O error from java so I suspect that I need some routine or library to pass data between the web app and the native routines running inside the Raspberry .
Thanks for your help.
Last edited: