Auto Boot And Connect To Ezb

 
#1

I have a fortune teller I built a couple of years ago, powered by an EZB. The computer which operates it is mounted in the cabinet. This allow security as it sits in a barn open to the public.

To turn the fortune teller on, we have to open the cabinet, start the computer, go to EZ builder, make the connection, etc. then lock it up again. Few know how to navigate the startup steps required in the EZ Builder software to get it running.

My question: is there a way an automatic start file can be made, so when the computer is turned on everything can be loaded and the program starts?

I already have the EZB, start a run script when it connects. which starts the builder program.

I have no clue if or how this can be done. Any ideas? I am sure others, have robots, which would like a feature allowing it to be turn on with a switch, and the robot could "self start".

#2

This takes a few steps, but is not too hard.

1) First, you need a connection script in your project that will automatically connect to the EZ-B when EZ-Builder is started.

Code:


if (isconnected(0) = 0)
controlcommand("connection", connect0)
else
endif



This will do it, but you might want to put it in a loop so it runs every 30 seconds or minute in case the EZ-B isn't powered up when it runs, or to reconnect if you loose connection. Change the "0"s to the EZ-B board number if you have more than one in the project. If you do add a loop, and intentionally want to disconnect from the EZ-B, stop the script before disconnecting.

2) Use the Shortcut Creator in EZ-Builder (on the options tab) to create a shortcut to your EZ-Builder project, and select your connection script to run at startup. Put the shortcut on your desktop for now.

3) Copy/move your link to your startup folder. In Windows 7, this was easy. It was a folder in your start menu. In windows 8 and above it is a little more complex. See https://scottiestech.info/2015/10/23/where-is-the-startup-folder-in-windows-10/ for instructions.

Alan

#3

Alan's spot on. However, it's been my experience that if I run a script telling ez builder to connect to a ezb after a connection has been established that the ezb will disconnect. If you run a connection loop you may have your ezb cycling the connection on and off. I'm not sure anymore but I think there's a command that will check your connection and reconnect if it finds it disconnected.

#4

@Dave. Look at my script. It checks to see if there is a connection, and only issues the connection command if there is not a connection.

This works fine in a loop, and I have used it in one before, just don't have it in a current project because it does interfere when I am doing development and stopping my connection on purpose.

Alan

#5

Hi Alan,
I will give it a try.

Thanks,

#6

Excellent. I should have looked at your script closer. My apologies for any confusion.

Thanks for the script. I've been wanting to put this exact thing in my project. Smile

#7

@Alan... Not to be picky or anything, but you can take out the "else" in your above script...

Code:


if (isconnected(0) = 0)
controlcommand("connection", connect0)
endif

#8

Quote:


Not to be picky or anything, but you can take out the "else" in your above script...



Yeah... This script has seen some edits in the project I copied it from. There used to be an else condition which has since been deleted.

Alan

#9

Works fine,except I am using two WiFi dongles. I need a something to connect the ezb to the computer using the right dongle. Is it possible? Can something be built in the startup folder?

#10

hmm...it doesn't auto-reconnect when the EZ-B (or the computer) powers up?

What is the architecture? Are you using one dongle for internet (or home network through a router) and hte other for EZ-B's network? If that is the case, I would put the EZ-B in client mode, and in your router, assign it a static IP so it is always the same IP n the project.

Alan