Welcome Guest! To enable all features please Login or Register.
Options
Go to last post Go to first unread
datrez  
#1 Posted : Sunday, December 13, 2015 5:30:21 PM(UTC)
datrez

Rank: Advanced Member

Groups: BetaUser, Registered
Joined: 9/28/2015(UTC)
Posts: 31

Thanks: 1 times
Was thanked: 5 time(s) in 5 post(s)
Hi,
When I try to download this Custom node to my Due board, Embrio crashes and I have to restart it. What I do notice is when the #define or the Adafruit_ssd1306syp is placed into the Deceleration it starts this issue. Why is this happening? This is not an easy library to dissect into a Custom node without using libraries.

Libraries from Amazon purchase can be found here:
https://cloud.mail.ru/pu...20FZ1112%20FZ1113%20.rar

<EmbrioCopy>
<Version>1.2.9.0</Version>
<Nodes>
<Node>
<UniqueID>b8360265-069b-41f0-a679-9db150a0c984</UniqueID>
<AssemblyType>Embrio.NodeEngine.AgentController.Nodes.AgentControllerCustomArduinoNode</AssemblyType>
<NodeType>Custom Arduino Node</NodeType>
<UserDefinedName></UserDefinedName>
<Description>A node that lets you write any Arduino code to interact with the Arduino hardware. Can be both an input and output.</Description>
<NodeColor>144,183,227,255</NodeColor>
<X>0</X>
<Y>0</Y>
<Width>785</Width>
<IncludeCode>#include &lt;Adafruit_ssd1306syp.h&gt;</IncludeCode>
<DeclerationCode>#define SDA_PIN 20
#define SCL_PIN 21
Adafruit_ssd1306syp display(SDA_PIN,SCL_PIN);</DeclerationCode>
<SetupCode>display.initialize();</SetupCode>
<ImageName>arduino.png</ImageName>
<InfoURL></InfoURL>
<CodeDefinitions>
<CodeDefinition>
<UpdateCondition>EveryUpdate</UpdateCondition>
<Code> display.drawLine(0, 0, 127, 63,WHITE);
display.update();
delay(1000);
display.clear();
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println(&amp;quot;Hello, world!&amp;quot;);
display.setTextColor(BLACK, WHITE); // &amp;apos;inverted&amp;apos; text
display.println(3.141592);
display.setTextSize(2);
display.setTextColor(WHITE);
display.print(&amp;quot;0x&amp;quot;); display.println(0xDEADBEEF, HEX);
display.update();
display.clear();</Code>
<UniqueID>f8d2718b-bcc6-4bb7-8962-53e7ba48a2b4</UniqueID>
</CodeDefinition>
</CodeDefinitions>
<Inputs></Inputs>
<Outputs></Outputs>
</Node>
</Nodes>
</EmbrioCopy>
thanks 1 user thanked datrez for this useful post.
sample@email.tst on 4/7/2024(UTC)
EmbrioAdmin  
#2 Posted : Monday, December 14, 2015 3:23:54 AM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 109 time(s) in 104 post(s)
That's very strange, I can't think of how that could be happening. I'm out of town for 2 more days, I'll look into this as soon as I can. In the mean time, can you try uploading the compiled program manually and see if it errors? The path where it is saved gets logged to the output window when you connect or upload in embrio.
thanks 1 user thanked EmbrioAdmin for this useful post.
sample@email.tst on 4/7/2024(UTC)
datrez  
#3 Posted : Monday, December 14, 2015 4:11:32 AM(UTC)
datrez

Rank: Advanced Member

Groups: BetaUser, Registered
Joined: 9/28/2015(UTC)
Posts: 31

Thanks: 1 times
Was thanked: 5 time(s) in 5 post(s)
Thanks for replying so fast. Well, the program is uploading using the "ArduinoCompiled" sketch from the user directory, but crashes Embrio when trying from it.

Thanks,
Greg
thanks 1 user thanked datrez for this useful post.
sample@email.tst on 4/7/2024(UTC)
EmbrioAdmin  
#4 Posted : Monday, December 14, 2015 6:38:34 AM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 109 time(s) in 104 post(s)
Thanks for the info. I'll look into this as soon as I can. In the mean time if you upload with the arduino ide you can press the connect button in embrio again and it should connect, assuming whatever this bug is won't prevent it. It's annoying but should work.
thanks 1 user thanked EmbrioAdmin for this useful post.
sample@email.tst on 4/7/2024(UTC)
EmbrioAdmin  
#5 Posted : Thursday, December 17, 2015 5:59:19 PM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 109 time(s) in 104 post(s)
I need to test more with the Due. I've had a bit of success though. I'm going to write up a page for each board that requires some extra attention to have this info in an easy to access place, but for now I'll write what I've found here.

Connect your usb to the "Programming Port", which is the one in the middle, closest to the power input.

Upload a program via the Arduino IDE by selecting "Arduino Due (Programming Port)" from the Port list, and when it is successful, close the Arduino IDE to save the settings.

In Embrio, select the Arduino Mega for the board, it has the same pin layout as the Due.

Go to View -> Options, and check "Upload to last board set in Arduino IDE". I haven't been able to figure out how to upload to the Due via command line while specifying the board. I've asked at the Aduino forum, hopefully I'll get a response.

That's been working for me when I use a digital output node on pin 13, I'm able to connect and turn on and off the built in LED.

For your node, there are a couple things.

First, change the Include line to use "" instead of <>. That has to do with how the include files are accessed when Arduino does the final compile. Using "" looks in the same folder as the .ino, which is what we want. Using <> looks at installed libraries. You might need to also open your .h file and change the includes. I'm going to do this automatically when the include files are copied into the compile folder, but do it manually for now.

Most importantly, remove the delay(1000); line from your update, that will break the Embrio program. Let Embrio do all of the timing, custom nodes shouldn't have any delay calls except for some very specific situations.

Let me know if you have any success. Like I said I need to experiment a bit more and change a few things to make this an easier experience.

Edited by user Thursday, December 17, 2015 6:00:28 PM(UTC)  | Reason: Not specified

thanks 1 user thanked EmbrioAdmin for this useful post.
sample@email.tst on 4/7/2024(UTC)
datrez  
#6 Posted : Friday, December 18, 2015 4:28:37 PM(UTC)
datrez

Rank: Advanced Member

Groups: BetaUser, Registered
Joined: 9/28/2015(UTC)
Posts: 31

Thanks: 1 times
Was thanked: 5 time(s) in 5 post(s)
Thanks for the info.
I have tried what you suggested, and it seems the crashing of Embrio continues. It is definitely because of this Custom node. Are you having the same Embrio crashing results when Using the "Compile and Uploade" button using another board selection? Which board did you select to make it work, because there are "Arduino Mega ADK", "Arduino Mega or Mega 2560" (then second selection "Unkown", "atmega1280", "atmega2560"), and "CONTROLLINO MEGA". I am using 1.2.9. on a Windows 10 Pro laptop.

Thanks,
Greg
thanks 1 user thanked datrez for this useful post.
sample@email.tst on 4/7/2024(UTC)
EmbrioAdmin  
#7 Posted : Friday, December 18, 2015 4:44:24 PM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 109 time(s) in 104 post(s)
Could you give me a little more info on how the program crashes, I'm not able to reproduce it. Do you get a message or does the program close?

If you use the "Upload to last board" option it shouldn't matter what Arduino you select becaues it uses the settings last used by the Arduino IDE, the selection just determines what pins are available in input and output nodes.

Someone else is also reporting a compile time crash. I'll keep digging. Knowing a little more about how it crashes might help track it down.
thanks 1 user thanked EmbrioAdmin for this useful post.
sample@email.tst on 4/7/2024(UTC)
EmbrioAdmin  
#8 Posted : Friday, December 18, 2015 4:59:53 PM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 109 time(s) in 104 post(s)
Never mind I was able to reproduce. I'll have a new installer ready this weekend. For now you can get version 1.2.8 from the download page if this is holding you up.

Thanks for posting about this problem!
thanks 1 user thanked EmbrioAdmin for this useful post.
sample@email.tst on 4/7/2024(UTC)
EmbrioAdmin  
#9 Posted : Sunday, December 20, 2015 11:28:24 AM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 109 time(s) in 104 post(s)
The new installer fixes this issue. Thanks again for alerting me to it!
thanks 1 user thanked EmbrioAdmin for this useful post.
sample@email.tst on 4/7/2024(UTC)
datrez  
#10 Posted : Tuesday, December 22, 2015 8:27:27 AM(UTC)
datrez

Rank: Advanced Member

Groups: BetaUser, Registered
Joined: 9/28/2015(UTC)
Posts: 31

Thanks: 1 times
Was thanked: 5 time(s) in 5 post(s)
Hi,
The issue is fixed, but now the sketch from the "Upload a new Connection Program" is not the same program as the "Compile and Upload the controller to a connected Arduino".
Example....Everything works as expected in the "Connect to a connected controller mode" then when selecting "Upload a new Connection Program" button the Sketch is not updated to make the changes for the Custom nodes, and has the previous version of sketch. I proved this by looking in the Roaming file and seeing the differences in sketches.
thanks 1 user thanked datrez for this useful post.
sample@email.tst on 4/7/2024(UTC)
EmbrioAdmin  
#11 Posted : Tuesday, December 22, 2015 8:31:25 AM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 109 time(s) in 104 post(s)
Interesting I'll take a look. There was a bug once where changes to a custom node weren't noticed by the compiler, I thought that was fixed but I might have missed something. (Or more likely messed something up in the last update)

Edited by user Tuesday, December 22, 2015 8:34:47 AM(UTC)  | Reason: Not specified

datrez  
#12 Posted : Tuesday, December 22, 2015 10:23:47 AM(UTC)
datrez

Rank: Advanced Member

Groups: BetaUser, Registered
Joined: 9/28/2015(UTC)
Posts: 31

Thanks: 1 times
Was thanked: 5 time(s) in 5 post(s)
It looks like it is related to the Upload using last board option.
datrez  
#13 Posted : Tuesday, December 22, 2015 12:06:06 PM(UTC)
datrez

Rank: Advanced Member

Groups: BetaUser, Registered
Joined: 9/28/2015(UTC)
Posts: 31

Thanks: 1 times
Was thanked: 5 time(s) in 5 post(s)
Hi,
Also on another note, the application works perfect when I am connected with Embrio, but when uploading the application to the DUE...it will not follow the same timing. I have refresh rate set to 2 set for all the timing (500 Miliseconds right), but when downloaded following the Transmit and recieve LED it looks like around (125 Miliseconds). This could be fixed when the above issue is addressed.

Happy Holidays,
Greg
EmbrioAdmin  
#14 Posted : Tuesday, December 22, 2015 2:29:37 PM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 109 time(s) in 104 post(s)
I'm playing with the below node and making changes to the gain then hitting the "upload a new connection program" and things seem to be working, with "use last ArduinoIDE" setting on and off. That's not a very exhaustive test though, what kinds of changes are you making that aren't being represented in the compiled code?

I'll do some more testing with the Due tonight.

<EmbrioCopy>
<Version>1.3.0.0</Version>
<Nodes>
<Node>
<UniqueID>bae25119-d374-4e1f-849d-5c99d2ff12a6</UniqueID>
<AssemblyType>Embrio.NodeEngine.AgentController.Nodes.AgentControllerCustomArduinoNode</AssemblyType>
<NodeType>Custom Arduino Node</NodeType>
<UserDefinedName></UserDefinedName>
<Description>A node that lets you write any Arduino code to interact with the Arduino hardware. Can be both an input and output.</Description>
<NodeColor>144,183,227,255</NodeColor>
<X>0</X>
<Y>0</Y>
<Width>403</Width>
<IncludeCode></IncludeCode>
<DeclerationCode>float gain = 0.8f;</DeclerationCode>
<SetupCode></SetupCode>
<ImageName>arduino.png</ImageName>
<InfoURL></InfoURL>
<CodeDefinitions>
<CodeDefinition>
<UpdateCondition>InputChange</UpdateCondition>
<Code>Output_Activation = Input_Activation * gain;
</Code>
<UniqueID>6095a4e5-2f96-43d2-a967-1418d0bc2562</UniqueID>
<Inputs>
<Input>9fa7cdb2-c631-46cc-ac32-6b7baaf583cb</Input>
</Inputs>
</CodeDefinition>
</CodeDefinitions>
<Inputs>
<Input>
<UniqueID>9fa7cdb2-c631-46cc-ac32-6b7baaf583cb</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Activation</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<ConnectedOutputs></ConnectedOutputs>
<BlendMode>Add</BlendMode>
<DisconnectedValue>0.606</DisconnectedValue>
<UseNegativeRange>False</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Input>
</Inputs>
<Outputs>
<Output>
<UniqueID>ba0806fa-7a03-43c0-9f7a-f18d92cc8349</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Activation</DefaultName>
<CustomName></CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeOutput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<MinValue>0</MinValue>
<MaxValue>1</MaxValue>
<UseNegativeRange>False</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Output>
</Outputs>
</Node>
</Nodes>
</EmbrioCopy>
EmbrioAdmin  
#15 Posted : Tuesday, December 22, 2015 5:26:05 PM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 109 time(s) in 104 post(s)
I just uploaded a new installer that has some things worked out with the Due. Its now selectable in the list of boards so you don't need to use "last IDE settings". It also does a better job at parsing the weird compile outputs that are Due specific.

Using the Programming Port I've been having good luck. The upload takes a while and sometimes the compile breaks and returns a weird error about an unsupported processor but always seems to work after a second try. I'm not sure what is up with that error.

I can also upload a final program and the timing seems good. I have a 1 second blink and by my eyes it looks correct, certainly not off by 50%. Below is pasted a 1 second blink that I used to test. Does it look off on your board?

EmbrioAdmin  
#16 Posted : Tuesday, December 22, 2015 5:29:11 PM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 109 time(s) in 104 post(s)
For another timing test I used the below nodes on an agent with a refresh rate of 2. Compiled and uploaded it looks like it's blinking on and off once per second (500 ms on and off). Does it look off on your board?

datrez  
#17 Posted : Tuesday, December 22, 2015 6:00:14 PM(UTC)
datrez

Rank: Advanced Member

Groups: BetaUser, Registered
Joined: 9/28/2015(UTC)
Posts: 31

Thanks: 1 times
Was thanked: 5 time(s) in 5 post(s)
If you upload this Custom node using the "upload new connection" button, then change the text to something other than Pressure...then use the "Compile and Upload the controller to a connected Arduino", it will not change. I physically have an OLED connected and see the results as well.

<EmbrioCopy>
<Version>1.3.0.0</Version>
<Nodes>
<Node>
<UniqueID>e11f5942-6a63-4702-bcb2-e306f0b9ec66</UniqueID>
<AssemblyType>Embrio.NodeEngine.AgentController.Nodes.AgentControllerCustomArduinoNode</AssemblyType>
<NodeType>Custom Arduino Node</NodeType>
<UserDefinedName></UserDefinedName>
<Description>A node that lets you write any Arduino code to interact with the Arduino hardware. Can be both an input and output.</Description>
<NodeColor>144,183,227,255</NodeColor>
<X>0</X>
<Y>0</Y>
<Width>785</Width>
<IncludeCode>#include &quot;Adafruit_ssd1306syp.h&quot;
</IncludeCode>
<DeclerationCode>#define SDA_PIN 20
#define SCL_PIN 21
Adafruit_ssd1306syp display(SDA_PIN,SCL_PIN);</DeclerationCode>
<SetupCode> display.initialize();</SetupCode>
<ImageName>arduino.png</ImageName>
<InfoURL></InfoURL>
<CodeDefinitions>
<CodeDefinition>
<TriggerInputID>62802f12-e026-4fc7-b54a-c900f60308c3</TriggerInputID>
<UpdateCondition>EveryUpdate</UpdateCondition>
<Code> display.update();
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(10,0);
display.setTextColor(WHITE);
display.println(&amp;quot;Pressure&amp;quot;);
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(50,20);
display.println(Input_Pressure);
display.setTextSize(1);
display.setTextColor(WHITE);
display.setCursor(0,55);
display.print(Input_Pump1);
display.setCursor(70,55);
display.println(Input_Pump2);
display.setCursor(45,42);
display.println(Input_VFDControl *100,1);
display.update();
display.clear();</Code>
<UniqueID>17d77840-720f-4732-8669-e5d9ea4e2414</UniqueID>
<Inputs>
<Input>c7e3674f-b6ce-47f3-bd9b-a4d3d3982d25</Input>
</Inputs>
</CodeDefinition>
</CodeDefinitions>
<Inputs>
<Input>
<UniqueID>c7e3674f-b6ce-47f3-bd9b-a4d3d3982d25</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Integer</DefaultName>
<CustomName>Pressure</CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Integer</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.IntegerNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<ConnectedOutputs>
<Output>8482104d-0aa3-43c9-823c-047851e41a0c</Output>
</ConnectedOutputs>
<DisconnectedValue>0</DisconnectedValue>
<MinValue>0</MinValue>
<MaxValue>200</MaxValue>
</Input>
<Input>
<UniqueID>59b7c325-a7f9-47dd-a297-86f6951430b7</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Text</DefaultName>
<CustomName>Pump1</CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>String</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.StringNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<ConnectedOutputs>
<Output>87c552b4-a0a3-40ae-9c89-fbc3b1e129f2</Output>
</ConnectedOutputs>
<DisconnectedValue></DisconnectedValue>
<MaxLength>10</MaxLength>
</Input>
<Input>
<UniqueID>88c759a0-086e-4770-972a-6ea2d2e23940</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Text 1</DefaultName>
<CustomName>Pump2</CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>String</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.StringNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<ConnectedOutputs>
<Output>5af09933-1127-40f6-885d-74167cb6c26a</Output>
</ConnectedOutputs>
<DisconnectedValue></DisconnectedValue>
<MaxLength>10</MaxLength>
</Input>
<Input>
<UniqueID>79ccff9e-9b63-4948-971b-2d1b7923df27</UniqueID>
<DefinitionID>00000000-0000-0000-0000-000000000000</DefinitionID>
<DefaultName>Activation 1</DefaultName>
<CustomName>VFDControl</CustomName>
<IsDisplayed>True</IsDisplayed>
<IsNative>False</IsNative>
<TypeName>Numeric</TypeName>
<IsOutsideConnection>False</IsOutsideConnection>
<IOType>Embrio.NodeEngine.NodeIO.NumericNodeInput</IOType>
<ShowGraph>False</ShowGraph>
<LinkedIOID>00000000-0000-0000-0000-000000000000</LinkedIOID>
<IsUserAdded>True</IsUserAdded>
<ConnectedOutputs>
<Output>54860491-18e0-4d7d-9502-0c8187ca1544</Output>
</ConnectedOutputs>
<BlendMode>Add</BlendMode>
<DisconnectedValue>0.826</DisconnectedValue>
<UseNegativeRange>False</UseNegativeRange>
<CanUseNegativeRange>True</CanUseNegativeRange>
</Input>
</Inputs>
<Outputs></Outputs>
</Node>
</Nodes>
</EmbrioCopy>

The other issue I speak of...is the OLED is pulsing faster than twice a second (refresh rate set for 2) when the "Compile and Upload the controller to a connected Arduino" is used.
EmbrioAdmin  
#18 Posted : Tuesday, December 22, 2015 6:14:49 PM(UTC)
EmbrioAdmin

Rank: Administration

Groups: Administrators
Joined: 12/11/2014(UTC)
Posts: 661

Thanks: 1 times
Was thanked: 109 time(s) in 104 post(s)
Ah, when the input default value changes. Thanks I didn't notice that, I'll put it on top of the to-do list.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error