sborsay / AWS-Serverless-IoT-Book

All Code, Corrections, and Relevant Material for AWS Serverless IoT Book. Find it on Amazon here: https://www.amazon.com/AWS-Serverless-IoT-Inexpensive-Projects-ebook/dp/B0B9P325F7
7 stars 1 forks source link

Issue with Chapter 12: Step 5 #4

Open techtoys opened 1 year ago

techtoys commented 1 year ago

Hi Stephen

I am following Chapter 12: step 5 to plot a chart of temperature and humidity on the S3 static website. The result I have got is different from the illustration on your book with two horizontal straight lines for temperature and humidity. Instead, there are only two points for both parameters as screen capture attached. That points never plotted on the chart.

2023-11-02_16h58_22

It seems to me that the drawChart function in main.js is not doing the intended job. But that main.js is simply a cut-and-paste from this Github so I need to seek your advice.

Another question is: in main.js :: getWheatherData = function () there are logging functions for debug purpose, I believe. They are console.log(\'data\', data) and console.error(\"JSON error: \" + status). Is there any way that I can view the log ?

Thank you for your help in advance.

John

techtoys commented 1 year ago

Stephen

Sorry, that is a stupid mistake with choosing the wrong region! Everything is OK now when I switch it back to us-east-1.

John

sborsay commented 1 year ago

Ok, no problem.Sent from my iPhoneOn Nov 2, 2023, at 2:14 AM, John Leung @.***> wrote: Stephen Sorry, that is a stupid mistake with choosing the wrong region! Everything is OK now when I switch it back to us-east-1. John

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

techtoys commented 1 year ago

Stephen

Chapter 12: Step 5

In main.js :: getWheatherData = function () there are logging functions for debug purpose, I believe. They are console.log(\'data\', data) and console.error("JSON error: " + status). Is there any way that I can view the log in aws or something ?

John

sborsay commented 1 year ago

Code in the browser is not going to be captured by AWS logging.  You can debug the code directly as you noted with those web  functions but obviously you will lose AWS visibility after the requested data object is requested.Sent from my iPhoneOn Nov 2, 2023, at 6:07 PM, John Leung @.***> wrote: Stephen Chapter 12: Step 5 In main.js :: getWheatherData = function () there are logging functions for debug purpose, I believe. They are console.log(\'data\', data) and console.error("JSON error: " + status). Is there any way that I can view the log in aws or something ? John

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

johnleung00 commented 1 year ago

Stephen

Got it. Thank you.