![]() Here is a crude script to accomplish this: If 'Username' is present in the input data, then I can proceed. In order to do this, I will need to send a newline, wait for a second, and then read the data. Now let's create a Python script and handle the login process. There was more on the screen, but you get the picture.Īs you can see we are able to send data to the console and read from it. inWaiting() will tell us the number of bytes ready to be read. Let's try sending a newline down the channel (note, this is a Windows-style newline) I can then verify that the serial port is open using the isOpen() method.Īt this point, I need to write and read from the serial port. After some experimentation I was able to do the following: The first thing I need to do is establish a serial connection. But for a quick and easy solution-why can't you just programmatically configure the device using the serial console connection?įirst, I am working on an old Windows machine that has Python 2.7.6 installed. ![]() ![]() There are obviously "zero touch" ways to accomplish this like Cisco's POAP or Arista's ZTP. For example, disable any DHCP server, configure SSH, add a user, etc. But you still might need a minimal starting configuration to safely add the device to the network. Now once the device is on the network, then you can configure it using SSH or using an API. You have a brand new router and you want to fully automate the configuration process? ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |