The following error occurs only in debug mode, not in release mode.
Line 138 = End Sub
The log reads:
Error occurred on line: 138 (Main)
Program terminated (StartMessageLoop was not called).
java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
at anywheresoftware.b4a.BA$2.run(BA.java:202)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:113)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:136)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:301)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:79)
at anywheresoftware.b4a.Shell
BA.raiseEvent2(ShellBA.java:92)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:70)
at b4j.example.main.main(main.java:29)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:221)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:79)
... 16 more
java.lang.RuntimeException: java.util.NoSuchElementException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:70)
at b4j.example.main.main(main.java:29)
Caused by: java.util.NoSuchElementException
at java
.util.LinkedList.removeFirst(LinkedList.java:270)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:320)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:79)
... 3 more
[/CODE]
Stream1 is sent from an Arduino computer with the following code:
.
Am I doing something wrong?
Harry
Line 138 = End Sub
B4X:
Sub Stream1_NewText (Text As String) 'receive information from the IntelMeterSupport node
pos1=Text.IndexOf(s)
mcode=Text.SubString2(0,pos1)
If mcode=3 Then 'Registration
DoRegistration(Text)
else if mcode=4 Then 'Movement
GetWebcam
else if mcode=5 Then 'Date/time
mcode=6
Stream2.Write(mcode & s & Text.SubString(2) & CRLF )
End If
End Sub
The log reads:
Error occurred on line: 138 (Main)
Program terminated (StartMessageLoop was not called).
java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
at anywheresoftware.b4a.BA$2.run(BA.java:202)
at anywheresoftware.b4a.keywords.SimpleMessageLoop.runMessageLoop(SimpleMessageLoop.java:30)
at anywheresoftware.b4a.StandardBA.startMessageLoop(StandardBA.java:26)
at anywheresoftware.b4a.ShellBA.startMessageLoop(ShellBA.java:113)
at anywheresoftware.b4a.keywords.Common.StartMessageLoop(Common.java:136)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:301)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:79)
at anywheresoftware.b4a.Shell
BA.raiseEvent2(ShellBA.java:92)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:70)
at b4j.example.main.main(main.java:29)
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:221)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:79)
... 16 more
java.lang.RuntimeException: java.util.NoSuchElementException
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:108)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:70)
at b4j.example.main.main(main.java:29)
Caused by: java.util.NoSuchElementException
at java
.util.LinkedList.removeFirst(LinkedList.java:270)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:320)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:159)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:79)
... 3 more
[/CODE]
Stream1 is sent from an Arduino computer with the following code:
.
B4X:
String message = "";
message = mcode + s + tempinside + s + lightinside + s + humidityinside + s + outside.temp + s + outside.humidity + s + outside.pressure + s + outside.lowbat + s + outside.voltage + s + newreg.elecconsumption + s + interval + s + minute + s + hour + s + year + s + month + s + week + s + day + s + newreg.eleccount + s + newreg.gascount + s;
WiFly.println(message);
Am I doing something wrong?
Harry