Rocket Launch Notifications via API


#41


#42

Unfortunately, I am not. I quickly shifted over to a dedicated thread, where I’ve made a lot of improvements to the piston. (although I did remove the Florida section… That piston keeps track of all locations)


Thanks for the image…

What happens when “IF Time & Date happens daily at X” triggers? (line 89)

Without seeing a log, I would guess that maybe the GET request was sent, but the 20 sec wakeup afterwards cancelled the rest of the code?


#43

Here’s the log that ran this morning, for the launch today. NextLaunch appears to be set correctly. For whatever reason, I don’t think the Date & Time trigger is working. Everything else seems okay.

6/26/2020, 12:34:59 AM +65ms
+1ms ╔Received event [Home].time = 1593146100000 with a delay of -935ms
+105ms ║RunTime Analysis CS > 22ms > PS > 39ms > PE > 44ms > CE
+108ms ║Runtime (66011 bytes) successfully initialized in 39ms (v0.3.110.20191009) (106ms)
+109ms ║╔Execution stage started
+119ms ║║Cancelling statement #1's schedules...
+126ms ║║Sending external web request to: fdo.rocketlaunch.live/json/launches/next/5
+902ms ║║Executed virtual command httpRequest (775ms)
+906ms ║║Executed virtual command setVariable (2ms)
+918ms ║║Comparison (dynamic) FL is (string) FL = true (1ms)
+920ms ║║Condition #20 evaluated true (6ms)
+921ms ║║Condition group #19 evaluated true (state did not change) (7ms)
+923ms ║║Cancelling statement #21's schedules...
+928ms ║║Executed virtual command setVariable (3ms)
+935ms ║║Comparison (boolean) true is (boolean) true = true (1ms)
+937ms ║║Condition #26 evaluated true (5ms)
+938ms ║║Condition group #25 evaluated true (state did not change) (6ms)
+940ms ║║Cancelling statement #69's schedules...
+945ms ║║Executed virtual command setVariable (2ms)
+953ms ║║Calculating (datetime) 1593131700014 - (datetime) 1593146100016 >> (datetime) -14400002
+957ms ║║Calculating (decimal) -1.4400002E7 / (decimal) 3600000.0 >> (decimal) -4.000000555555555
+974ms ║║Calculating (date) 1593144000000 + (time) 72780000 >> (datetime) 1593216780000
+979ms ║║Executed virtual command setVariable (2ms)
+985ms ║║Executed virtual command setVariable (2ms)
+991ms ║║Executed virtual command setVariable (3ms)
+996ms ║║Executed virtual command setVariable (2ms)
+1002ms ║║Executed virtual command setVariable (2ms)
+1008ms ║║Executed virtual command setVariable (2ms)
+1014ms ║║Executed virtual command setVariable (3ms)
+1021ms ║║Calculating (string) Next FL launch is at + (string) 2020-06-26T20:13Z >> (string) Next FL launch is at 2020-06-26T20:13Z
+1024ms ║║Calculating (string) Next FL launch is at 2020-06-26T20:13Z + (string) which is >> (string) Next FL launch is at 2020-06-26T20:13Z which is
+1027ms ║║Calculating (string) Next FL launch is at 2020-06-26T20:13Z which is + (string) Fri, Jun 26 2020 @ 4:13:00 PM EDT >> (string) Next FL launch is at 2020-06-26T20:13Z which is Fri, Jun 26 2020 @ 4:13:00 PM EDT
+1030ms ║║Next FL launch is at 2020-06-26T20:13Z which is Fri, Jun 26 2020 @ 4:13:00 PM EDT
+1031ms ║║Executed virtual command log (1ms)
+1054ms ║║Calculating (string) Falcon 9 + (string) is scheduled to launch the >> (string) Falcon 9 is scheduled to launch the
+1059ms ║║Calculating (string) Falcon 9 is scheduled to launch the + (string) [Starlink-10 (57x), BlackSky Global 5 & 6] >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6]
+1063ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] + (string) at >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at
+1068ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at + (string) Kennedy Space Center >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center
+1072ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center + (string) from pad >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad
+1076ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad + (string) LC-39A >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1079ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A + (string)
+1079ms ║║ >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1082ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1082ms ║║ + (string) A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC). >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1083ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC).
+1085ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1086ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC). + (string)
+1086ms ║║ >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1086ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC).
+1088ms ║║Calculating (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1088ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC).
+1089ms ║║ + (string) null >> (string) Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1089ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC).
+1089ms ║║null
+1092ms ║║Falcon 9 is scheduled to launch the [Starlink-10 (57x), BlackSky Global 5 & 6] at Kennedy Space Center from pad LC-39A
+1092ms ║║A SpaceX Falcon 9 rocket will launch the Starlink-10 (57x) mission on Friday, June 26, 2020 at 8:18 PM (UTC).
+1092ms ║║null
+1093ms ║║Executed virtual command log (1ms)
+1106ms ║║Calculating (string) 🚀 + (string) Falcon 9 >> (string) 🚀 Falcon 9
+1110ms ║║Calculating (string) 🚀 Falcon 9 + (string) is scheduled to launch from >> (string) 🚀 Falcon 9 is scheduled to launch from
+1114ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from + (string) Falcon 9 is scheduled to launch from [Starlink-10 (57x), BlackSky Global 5 & 6]
+1119ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from >> (string) 🚀 Falcon 9 is scheduled to launch from
+1123ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from + (string) Kennedy Space Center >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center
+1126ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center + (string) on >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on
+1130ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on + (string) Fri, Jun 26 2020 @ 4:13:00 PM EDT >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT
+1133ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT + (string) from pad >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT from pad
+1136ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT from pad + (string) LC-39A >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT from pad LC-39A
+1138ms ║║Calculating (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT from pad LC-39A + (string) . >> (string) 🚀 Falcon 9 is scheduled to launch from Kennedy Space Center on Fri, Jun 26 2020 @ 4:13:00 PM EDT from pad LC-39A.
+1141ms ║║Executed virtual command setState (0ms)
+1144ms ║╚Execution stage complete. (1034ms)
+1145ms ║Setting up scheduled job for Sat, Jun 27 2020 @ 12:35:00 AM EDT (in 86399.791s)
+1152ms ╚Event processed successfully (1152ms)

#44

That last block does not like to re-evaluate until it is inside that block.
Here is the technique I used on my Rocket piston to force an update a bit early.


#45

Thanks!

So during the daily update at 00:35, I set the nle variable to be calculated, then updated the alert block. A couple of questions:

  • You mention updating nle hourly. Do I really need to do that?
  • You have the alert block running for nle or what I’m guessing is the same value of nle. Do I need to do that? Wouldn’t that make it alert twice?

#46

I put mine inside a block that runs every hour, although looking back, I do not remember why I did that, LOL

You may be able to get away with only running that line on the times where the API is updated.


Well, there are two triggers there.
One is {nle} (which translates to launchTime -30)
The other is launchTime -91, which is the magic element I used to force the real time to be updated.

Note: I am not sure it matters, but logically, the {nle} trigger needs to be before the -91 line


#47

So I had a bit of a failure today. The launch was scrubbed around 1pm ET. At T-30 minutes, it triggered this time (yay!). However, it grabbed the info for whatever the next launch it found was, and announced that. How would I prevent that?


#48

I sincerely apologize. This was addressed and solved over in my forked thread.

Basically, the workaround I added to the top trigger was something like this:

pic

This forces extra API pulls in the hours leading up to the launch.
(which should catch any new changes, and update the variables before the event)