udotdevelopment / ATSPM

Automated Traffic Signal Performance Measures (ATSPM) are a series of visual aids that display the high-resolution data from signal controllers. They are a valuable asset management tool, aiding personnel in the control of both signal hardware and signal timing and coordination. They allow analysis of data collected 24 hours a day, 7 days a week, improving the accuracy, flexibility, and performance of signal equipment and the system as a whole. ATSPM are used to optimize mobility, manage traffic signal timing and maintenance, reduce congestion, save fuel costs and improve safety.
Apache License 2.0
75 stars 41 forks source link

Controllers not FTP'ing data to server #100

Closed ZachParkerCR closed 2 years ago

ZachParkerCR commented 2 years ago

We have version 4.2 installed in our environment. We are running into a strange issue that seems to have started a while ago for some of our signal controllers. There is no data being pulled into our server from the controllers over FTP and because of that, no data is being added to the database and made visible for these controllers anymore. We have about 60 controllers that started exhibiting this behavior out of our 191 total controllers. So around 130 are working just fine.

I can still ping the controllers with their IP addresses so that seems good. But what could be causing the FTP process to fail to pull down data from the controllers? I'm not seeing any clear errors logged anywhere to see if these specific controllers are having issues.

Any guidance to send me in the right direction would be helpful!

shanejohnson-atspm commented 2 years ago

Did you recently update the firmware on Econolite controllers? If so, the path to the FTP files has likely changed, and you will have to update the configuration to match that change.

ZachParkerCR commented 2 years ago

Hi Shane,

Unfortunately, I don’t manage the controllers, so I am not sure if the firmware changed. I can ask our Traffic guys if that happened though. What would the new path be and where would I adjust that in the ATSPM system?

Thanks,

Zach Parker Systems Analyst – Information Technology City of Cedar Rapids Email: @.**@.>

From: Shane Johnson @.> Sent: Wednesday, October 27, 2021 8:08 AM To: udotdevelopment/ATSPM @.> Cc: Parker, Zach M. @.>; Author @.> Subject: Re: [udotdevelopment/ATSPM] Controllers not FTP'ing data to server (Issue #100)

CAUTION:This email originated from outside the organization. Do not click links or open attachments unless you know the content is safe. Never provide your user ID and password!

Did you recently update the firmware on Econolite controllers? If so, the path to the FTP files has likely changed, and you will have to update the configuration to match that change.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/udotdevelopment/ATSPM/issues/100#issuecomment-952910143, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AMQRI567JLJUXGEZG56LEBTUI72TTANCNFSM5G2JEO3Q. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

[http://cedar-rapids.org/Email-Graphic-Customer-Service-3.png] https://survey123.arcgis.com/share/709743d7252949e68ae788238416d91d

ZachParkerCR commented 2 years ago

Did you recently update the firmware on Econolite controllers? If so, the path to the FTP files has likely changed, and you will have to update the configuration to match that change.

@shanejohnson-atspm Shane, it looks like the problem controllers ARE the controllers that have received a new firmware. I am able to FTP into the controllers and I see the same folder "/set1" that contains the data files. But what has changed that I need to adjust on the application side so it properly pulls down that data?

shanejohnson-atspm commented 2 years ago

The problem you will likely run into is in moe.common in SignalFtp.cs

The line is if (!ftpClient.DownloadFile(SignalFtpOptions.LocalDirectory + Signal.SignalID + @"\" + localFileName, ".." + Signal.ControllerType.FTPDirectory + @"/" + ftpListItem.Name))

The ".." is where the problem comes in, as it means "go up one level form where I am". But, that is what you have to keep in mind when you craft the path in the devicetypes table.

Also, you will likely have to add a device type to that table in order for all of your controllers to work, as you have the newer ones with a different path than the older ones.

ZachParkerCR commented 2 years ago

@shanejohnson-atspm, I am not a software developer, just a systems analyst and I'm trying to solve this problem, so my knowledge of editing lines of code is limited. Are you suggesting that I edit that line of code in the SignalFTP.cs file and remove the ".."? Where can I even find that SignalFTP.cs file on my server? I've looked in all the application folders and do not see that file.

ZachParkerCR commented 2 years ago

The problem you will likely run into is in moe.common in SignalFtp.cs

The line is if (!ftpClient.DownloadFile(SignalFtpOptions.LocalDirectory + Signal.SignalID + @"\" + localFileName, ".." + Signal.ControllerType.FTPDirectory + @"/" + ftpListItem.Name))

The ".." is where the problem comes in, as it means "go up one level form where I am". But, that is what you have to keep in mind when you craft the path in the devicetypes table.

Also, you will likely have to add a device type to that table in order for all of your controllers to work, as you have the newer ones with a different path than the older ones.

@shanejohnson-atspm , I have created a new device type row in the Controllers table. I'm still not quite sure how to format the FTPDirectory folder path in that row, though. But here is what I have to see if this works:

image

We have Cobalt controllers, some with the new firmware and most without the new firmware. I know the folder path on the controllers with the new firmware for the .DAT files is "/opt/econolite/set1". I'm just not sure how to format that file path in the database table to correctly get it to end up in the set1 folder.

shanejohnson-atspm commented 2 years ago

You should contact Econolite to see what they have in mind for this. It seems unlikely they would have made a breaking change like this without some provision for a workaround.

Like I said, the ".." means "go up one directory level". You will have to make note of where you start when you FTP to the controller. From there, the program will automatically go up one level. You will have to create the path string from there. If you start in the Set1 directory, the path string would be "/set1". If you start in the Econolite directory, the path string would be "/econolite/set1"

But, again, I suggest you contact your Econolite representative to get their input on how to handle this problem.

From: ZachParkerCR @.> Sent: Monday, November 1, 2021 7:15 AM To: udotdevelopment/ATSPM @.> Cc: Shane Johnson @.>; Mention @.> Subject: Re: [udotdevelopment/ATSPM] Controllers not FTP'ing data to server (Issue #100)

The problem you will likely run into is in moe.common in SignalFtp.cs

The line is if (!ftpClient.DownloadFile(SignalFtpOptions.LocalDirectory + Signal.SignalID + @"\" + localFileName, ".." + Signal.ControllerType.FTPDirectory + @"/" + ftpListItem.Name))

The ".." is where the problem comes in, as it means "go up one level form where I am". But, that is what you have to keep in mind when you craft the path in the devicetypes table.

Also, you will likely have to add a device type to that table in order for all of your controllers to work, as you have the newer ones with a different path than the older ones.

@shanejohnson-atspmhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fshanejohnson-atspm&data=04%7C01%7CShane.Johnson%40q-free.com%7C74e09ebf96b3477a9aa808d99d399e8e%7C39ef44caadfa4a248858ef68dbe16345%7C1%7C0%7C637713693067786929%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=mVUmoUwv2nfztsD3hR0aS16DKApLAqYYq0NRzH%2FdZaw%3D&reserved=0 , I have created a new device type row in the Controllers table. I'm still not quite sure how to format the FTPDirectory folder path in that row, though. But here is what I have to see if this works:

[image]https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fuser-images.githubusercontent.com%2F52499575%2F139676973-0adb1a02-a080-45fc-91c0-8d61404b2b99.png&data=04%7C01%7CShane.Johnson%40q-free.com%7C74e09ebf96b3477a9aa808d99d399e8e%7C39ef44caadfa4a248858ef68dbe16345%7C1%7C0%7C637713693067796919%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=4DWxWLBFXdx2mTXEmtKYTkzHr9H1TW9Xz0HyEvG%2BrV0%3D&reserved=0

We have Cobalt controllers, some with the new firmware and most without the new firmware. I know the folder path on the controllers with the new firmware for the .DAT files is "/opt/econolite/set1". I'm just not sure how to format that file path in the database table to correctly get it to end up in the set1 folder.

- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fudotdevelopment%2FATSPM%2Fissues%2F100%23issuecomment-956224065&data=04%7C01%7CShane.Johnson%40q-free.com%7C74e09ebf96b3477a9aa808d99d399e8e%7C39ef44caadfa4a248858ef68dbe16345%7C1%7C0%7C637713693067796919%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Pl%2BSjysDIA6G48Ec8Bnl92ErPnAflYEMqRY%2BrTzGd3c%3D&reserved=0, or unsubscribehttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHPHYURQ22QKCEUKHBEB2ALUJ2HFLANCNFSM5G2JEO3Q&data=04%7C01%7CShane.Johnson%40q-free.com%7C74e09ebf96b3477a9aa808d99d399e8e%7C39ef44caadfa4a248858ef68dbe16345%7C1%7C0%7C637713693067806912%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=LblQYW%2BB9eHYmbBmNBAp6M0Q4gDiMoGk4Sct4x%2FH9b4%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7CShane.Johnson%40q-free.com%7C74e09ebf96b3477a9aa808d99d399e8e%7C39ef44caadfa4a248858ef68dbe16345%7C1%7C0%7C637713693067806912%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=b1ydhK03UhRNL086Cq3KnkUeRI0i9ZkwOuWr4goNYDA%3D&reserved=0 or Androidhttps://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7CShane.Johnson%40q-free.com%7C74e09ebf96b3477a9aa808d99d399e8e%7C39ef44caadfa4a248858ef68dbe16345%7C1%7C0%7C637713693067816913%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=o9bst9alCN5f0%2FPBgdZaDEsQ5tt7%2BUmtCmRX8DBlbf8%3D&reserved=0.

ZachParkerCR commented 2 years ago

@shanejohnson-atspm , I think I actually have it working now. I used the path "/econolite/set1" in the FTPDirectory and that correctly allows the /set1 path to be the location to pull files from. It's successfully pulling down data from the signal now!

I appreciate your help. I wouldn't have known where to start without your guidance. Have a great week, sir!