Posted by jwilsonatvars
Henagon

IOT on cloned PI

Hey team...

Is there a way to script the setup of the IOT agent on a cloned machine? for example...The script would search for the teamviewer ID of the original machine (in this case a raspberry pi 3) if the old ID is found, the script would insert the necessary info to connect the clone to a teamviewer account automatically with a new teamviewer ID

Is this possible? Are there files that can be changed for an unattended setup of the IOT agent? We have hundreds of PIs about to go to the field and this would be HUGELY helpful. I'm solid on bash scripts I just need to know the files to mod.

Thanks!

2 Replies
1 Accepted Solution

Accepted Solutions
Posted by jwilsonatvars
Henagon
Solution

Re: IOT on cloned PI

Hey folks...

I answered my own question here. It does not appear there is a way to do this directly with IOT config files but it does work using expect. Here's the basics:

/usr/bin/teamviewer-iot-agent stop
rm -f /var/lib/teamviewer-iot-agent/global.conf
/usr/bin/teamviewer-iot-agent restart
/usr/bin/expect -c "
spawn teamviewer-iot-agent setup
expect \"Accept License Agreement? (y/n)\" {
send \"y\r\"
expect \"TeamViewer account (email):\"
send \"<email.address>\r\"
expect \"Password:\"
send \"<password>\r\"
exp_continue
}
"

And dont forget to reinstall the agent to fix any missing files...

/usr/bin/dpkg -i teamviewer-iot-agent-*.deb

enjoy!

2 Replies
Posted by jwilsonatvars
Henagon
Solution

Re: IOT on cloned PI

Hey folks...

I answered my own question here. It does not appear there is a way to do this directly with IOT config files but it does work using expect. Here's the basics:

/usr/bin/teamviewer-iot-agent stop
rm -f /var/lib/teamviewer-iot-agent/global.conf
/usr/bin/teamviewer-iot-agent restart
/usr/bin/expect -c "
spawn teamviewer-iot-agent setup
expect \"Accept License Agreement? (y/n)\" {
send \"y\r\"
expect \"TeamViewer account (email):\"
send \"<email.address>\r\"
expect \"Password:\"
send \"<password>\r\"
exp_continue
}
"

And dont forget to reinstall the agent to fix any missing files...

/usr/bin/dpkg -i teamviewer-iot-agent-*.deb

enjoy!

Posted by TeamViewer Staff
TeamViewer Staff

Re: IOT on cloned PI

Hello @jwilsonatvars 

Thank you for your post on our Community.

In order to assist with you with mass provisioning on your Raspberry Pi s, we will contact you directly. 

The suggested way will not work unfortunately and we would like to work with you on a method to easily povision your hundreds of Pi s.

Best regards,
Patrick