Hi There,
Still, new with the system and running into troubles.
With NetBeans, I have been modifying a java program to control sequences of speed, acceleration, and time applied to a stepper motor (NEMA-17 Bipolar 32mm Stepper) connected to a Phidget Stepper Bipolar HC (ID: 1067_0B). It works apparently fine on my laptop, and I am now trying to transfer the program on a Raspberry Pi3 to control it remotely through a wifi connection handled with VNC (today from my laptop, later if time allows from a mobile phone). Regarding the Raspberry Pi3 connection to my laptop, VNC works OK, and I can open smoothly my modified java program jared with the Phidget 21 libraries used by my program.
Still, I have also installed the Phidget libraries (21 and 22) on the Raspberry following the instructions on https://www.phidgets.com/docs/OS_-_Linux. HelloWorld does detect when I plug and unplug the Phidget, which is reassuring but insufficient.
Indeed, when connected to the Pi3, my modified java program opens but does not trigger the stepper motor and with my limited experience, I am running out of idea to check and implement. Any suggestion and comment would be greatly appreciated.
I have tried the approaches listed below. They do show there are problems but with HelloWorld working I guess that it is pointless to keep reinstalling the libraries especially as the relevant ones are jarred with my program… even though I have certainly been doing something wrong. I have tried 4 tests copied the error messages I was getting in case it could help identifying what's wrong :
a- From my modified java program… running "jar -java program.jar"
b- From "/libphidget-2.1.8.20170607/Java"… running "gcc com_phidgets_MotorControlPhidget.c -o MotorControl-simple"
c- From "/phidget21-c-examples-2.1.8.20170607"… running "gcc com_phidgets_ServoPhidget.c -o com_phidgets_ServoPhidget"
d- From "/phidget21-c-examples-2.1.8.20170607"… running "gcc MotorControl-simple.c -o MotorControl-simple"
a- From my modified java program… running "jar -java program.jar"... leads to...
Jun 29, 2018 11:31:28 PM com. program_Pi ButtonConnectActionPerformed
SEVERE: null
PhidgetException 13 (Given timeout has been exceeded.)
at com.phidgets.Phidget.waitForAttachment(Native Method)
at com. program_Pi.ButtonConnectActionPerformed(program_Pi.java:1172)
at com. program_Pi.access$300(program_Pi.java:68)
at com. program_Pi$4.actionPerformed(program_Pi.java:218)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6535)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6300)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4891)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Jun 29, 2018 11:31:36 PM com. program_Pi ParameterChecks
SEVERE: null
PhidgetException 5 (Phidget not physically attached.)
at com.phidgets.StepperPhidget.getCurrentMax(Native Method)
at com. program_Pi.ParameterChecks(program_Pi.java:897)
at com. program_Pi.Button_startActionPerformed(program_Pi.java:846)
at com. program_Pi.access$1700(program_Pi.java:68)
at com. program_Pi$18.actionPerformed(program_Pi.java:690)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
... same as above...
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Parameter Checks ran smoothly: true
Jun 29, 2018 11:31:36 PM com.program_Pi AccelerationCheck
SEVERE: null
PhidgetException 5 (Phidget not physically attached.)
at com.phidgets.StepperPhidget.getAccelerationMax(Native Method)
at com.program_Pi.AccelerationCheck(program_Pi.java:926)
at com.program_Pi.Button_startActionPerformed(program_Pi.java:847)
at com.program_Pi.access$1700(program_Pi.java:68)
at com.program_Pi$18.actionPerformed(program_Pi.java:690)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
... same as above...
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Acceleration Check ran smoothly: true
Jun 29, 2018 11:31:36 PM com.program_Pi Button_startActionPerformed
SEVERE: null
PhidgetException 5 (Phidget not physically attached.)
at com.phidgets.StepperPhidget.setCurrentLimit(Native Method)
at com.program_Pi.Button_startActionPerformed(program_Pi.java:851)
at com.program_Pi.access$1700(program_Pi.java:68)
at com.program_Pi$18.actionPerformed(program_Pi.java:690)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
... same as above...
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Jun 29, 2018 11:31:46 PM com.program_Pi Button_exitActionPerformed
SEVERE: null
PhidgetException 5 (Phidget not physically attached.)
at com.phidgets.StepperPhidget.setEngaged(Native Method)
at com.program_Pi.Button_exitActionPerformed(program_Pi.java:1051)
at com.program_Pi.access$100(program_Pi.java:68)
at com.program_Pi$20.actionPerformed(program_Pi.java:712)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
... same as above...
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
b- From "/libphidget-2.1.8.20170607/Java"... running "gcc com_phidgets_MotorControlPhidget.c -o MotorControl-simple"... leads to
"In file included from com_phidgets_MotorControlPhidget.c:21:0:
../stdafx.h:275:25: fatal error: pdictclient.h: No such file or directory
#include "pdictclient.h""
c- From "/libphidget-2.1.8.20170607/Java"... running "gcc com_phidgets_ServoPhidget.c -o com_phidgets_ServoPhidget"... leads to
"In file included from com_phidgets_ServoPhidget.c:21:0:
../stdafx.h:275:25: fatal error: pdictclient.h: No such file or directory
#include "pdictclient.h""
d- From "/phidget21-c-examples-2.1.8.20170607"... running "gcc MotorControl-simple.c -o MotorControl-simple"... leads to
"/tmp/ccaUOG8w.o: In function `AttachHandler':
MotorControl-simple.c:(.text+0x20): undefined reference to `CPhidget_getDeviceName'
MotorControl-simple.c:(.text+0x30): undefined reference to `CPhidget_getSerialNumber'
/tmp/ccaUOG8w.o: In function `DetachHandler':
MotorControl-simple.c:(.text+0x7c): undefined reference to `CPhidget_getDeviceName'
MotorControl-simple.c:(.text+0x8c): undefined reference to `CPhidget_getSerialNumber'
/tmp/ccaUOG8w.o: In function `display_properties':
MotorControl-simple.c:(.text+0x1d4): undefined reference to `CPhidget_getDeviceType'
MotorControl-simple.c:(.text+0x1e4): undefined reference to `CPhidget_getSerialNumber'
MotorControl-simple.c:(.text+0x1f4): undefined reference to `CPhidget_getDeviceVersion'
MotorControl-simple.c:(.text+0x204): undefined reference to `CPhidgetMotorControl_getInputCount'
MotorControl-simple.c:(.text+0x214): undefined reference to `CPhidgetMotorControl_getMotorCount'
/tmp/ccaUOG8w.o: In function `motorcontrol_simple':
MotorControl-simple.c:(.text+0x280): undefined reference to `CPhidgetMotorControl_create'
MotorControl-simple.c:(.text+0x294): undefined reference to `CPhidget_set_OnAttach_Handler'
MotorControl-simple.c:(.text+0x2a8): undefined reference to `CPhidget_set_OnDetach_Handler'
MotorControl-simple.c:(.text+0x2bc): undefined reference to `CPhidget_set_OnError_Handler'
MotorControl-simple.c:(.text+0x2d0): undefined reference to `CPhidgetMotorControl_set_OnInputChange_Handler'
MotorControl-simple.c:(.text+0x2e4): undefined reference to `CPhidgetMotorControl_set_OnVelocityChange_Handler'
MotorControl-simple.c:(.text+0x2f8): undefined reference to `CPhidgetMotorControl_set_OnCurrentChange_Handler'
MotorControl-simple.c:(.text+0x308): undefined reference to `CPhidget_open'
MotorControl-simple.c:(.text+0x320): undefined reference to `CPhidget_waitForAttachment'
MotorControl-simple.c:(.text+0x340): undefined reference to `CPhidget_getErrorDescription'
MotorControl-simple.c:(.text+0x38c): undefined reference to `CPhidgetMotorControl_setAcceleration'
MotorControl-simple.c:(.text+0x3a0): undefined reference to `CPhidgetMotorControl_setVelocity'
MotorControl-simple.c:(.text+0x3c0): undefined reference to `CPhidgetMotorControl_setAcceleration'
MotorControl-simple.c:(.text+0x3d4): undefined reference to `CPhidgetMotorControl_setVelocity'
MotorControl-simple.c:(.text+0x3f4): undefined reference to `CPhidgetMotorControl_setVelocity'
MotorControl-simple.c:(.text+0x408): undefined reference to `CPhidgetMotorControl_setAcceleration'
MotorControl-simple.c:(.text+0x428): undefined reference to `CPhidget_close'
MotorControl-simple.c:(.text+0x434): undefined reference to `CPhidget_delete'
collect2: error: ld returned 1 exit status"