René's URL Explorer Experiment


Title: "Error! Not connected to host." when using ISR · Issue #8 · StorageB/Google-Sheets-Logging · GitHub

Open Graph Title: "Error! Not connected to host." when using ISR · Issue #8 · StorageB/Google-Sheets-Logging

X Title: "Error! Not connected to host." when using ISR · Issue #8 · StorageB/Google-Sheets-Logging

Description: Hey, I'm trying to create a kind of stopwatch and for the best responsibility, I use an interrupt, from which the subroutine to send the data is called. (When I was trying the raw example it worked and I used as much as I could from the ...

Open Graph Description: Hey, I'm trying to create a kind of stopwatch and for the best responsibility, I use an interrupt, from which the subroutine to send the data is called. (When I was trying the raw example it worked...

X Description: Hey, I'm trying to create a kind of stopwatch and for the best responsibility, I use an interrupt, from which the subroutine to send the data is called. (When I was trying the raw example it wo...

Opengraph URL: https://github.com/StorageB/Google-Sheets-Logging/issues/8

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"\"Error! Not connected to host.\" when using ISR","articleBody":"Hey, \r\nI'm trying to create a kind of stopwatch and for the best responsibility, I use an interrupt, from which the subroutine to send the data is called.\r\n(When I was trying the raw example it worked and I used as much as I could from the example)\r\nAccording to the serial monitor, the values of my variables seem to be taken along correctly, but when the payload should get posted, it didn't work, and I got this response:\r\n```\r\nPublishing data...\r\n{\"command\": \"insert_row\", \"sheet_name\": \"Tabellenblatt1\", \"values\": \"4,406571,408355\"}\r\nError! Not connected to host.\r\nError while connecting\r\n```\r\nThis is my code: \r\n```\r\n#include \u003cArduino.h\u003e\r\n#include \u003cESP8266WiFi.h\u003e\r\n#include \"HTTPSRedirect.h\"\r\n\r\n#define ON_Board_LED 2\r\n#define BUTTON_PIN 0\r\n\r\nconst char* ssid     = \"myWiFi\";\r\nconst char* password = \"myPW\";\r\nconst char *GScriptId = \"my Script-ID\";\r\n\r\n// Enter command (insert_row or append_row) and your Google Sheets sheet name (default is Sheet1):\r\nString payload_base =  \"{\\\"command\\\": \\\"insert_row\\\", \\\"sheet_name\\\": \\\"Tabellenblatt1\\\", \\\"values\\\": \";\r\nString payload = \"\";\r\n\r\n// Google Sheets setup (do not edit)\r\nconst char* host = \"script.google.com\";\r\nconst int httpsPort = 443;\r\nconst char* fingerprint = \"\";\r\nString url = String(\"/macros/s/\") + GScriptId + \"/exec\";\r\nHTTPSRedirect* client = nullptr;\r\n\r\n// Declare variables that will be published to Google Sheets\r\nvolatile int run = 0;\r\nvolatile uint64_t time_start = 0;\r\nvolatile uint64_t time_finish = 0;\r\n\r\nvolatile bool running = false;\r\nvolatile uint64_t last_isr;\r\n\r\nvoid ICACHE_RAM_ATTR ISR() {\r\n  if (millis() - last_isr \u003e 500) { //bounce-filter\r\n    if (!running) {\r\n      time_start = millis();\r\n      running = true;\r\n      last_isr = millis();\r\n    } else {\r\n      time_finish = millis();\r\n      running = false;\r\n      run++;\r\n      last_isr = millis();\r\n      sendData(run, time_start, time_finish);\r\n    }\r\n  }\r\n}\r\n\r\nvoid setup() {\r\n  Serial.begin(9600);        \r\n  delay(10);\r\n  Serial.println('\\n');\r\n  \r\n  // Connect to WiFi\r\n  WiFi.begin(ssid, password);             \r\n  Serial.print(\"Connecting to \");\r\n  Serial.print(ssid); Serial.println(\" ...\");\r\n  while (WiFi.status() != WL_CONNECTED) {\r\n    delay(1000);\r\n    Serial.print(\".\");\r\n  }\r\n  Serial.println('\\n');\r\n  Serial.println(\"Connection established!\");  \r\n  Serial.print(\"IP address:\\t\");\r\n  Serial.println(WiFi.localIP());\r\n\r\n  // Use HTTPSRedirect class to create a new TLS connection\r\n  client = new HTTPSRedirect(httpsPort);\r\n  client-\u003esetInsecure();\r\n  client-\u003esetPrintResponseBody(true);\r\n  client-\u003esetContentTypeHeader(\"application/json\");\r\n  Serial.print(\"Connecting to \");\r\n  Serial.println(host);\r\n\r\n  // Try to connect for a maximum of 5 times\r\n  bool flag = false;\r\n  for (int i=0; i\u003c5; i++){ \r\n    int retval = client-\u003econnect(host, httpsPort);\r\n    if (retval == 1){\r\n       flag = true;\r\n       Serial.println(\"Connected\");\r\n       break;\r\n    }\r\n    else\r\n      Serial.println(\"Connection failed. Retrying...\");\r\n  }\r\n  if (!flag){\r\n    Serial.print(\"Could not connect to server: \");\r\n    Serial.println(host);\r\n    return;\r\n  }\r\n  delete client;    // delete HTTPSRedirect object\r\n  client = nullptr; // delete HTTPSRedirect object\r\n\r\n  pinMode(ON_Board_LED,OUTPUT); //--\u003e On Board LED port Direction output\r\n  digitalWrite(ON_Board_LED, HIGH); //--\u003e Turn off Led On Board\r\n  attachInterrupt(digitalPinToInterrupt(BUTTON_PIN), ISR, FALLING);\r\n}\r\n\r\nvoid loop() {\r\n  if (running) {\r\n    digitalWrite(ON_Board_LED, LOW);\r\n  } else {\r\n    digitalWrite(ON_Board_LED, HIGH);\r\n  }\r\n}\r\n\r\nvoid sendData(int run, uint64_t time_star, uint64_t time_finish) {\r\n  static bool flag = false;\r\n  if (!flag){\r\n    client = new HTTPSRedirect(httpsPort);\r\n    client-\u003esetInsecure();\r\n    flag = true;\r\n    client-\u003esetPrintResponseBody(true);\r\n    client-\u003esetContentTypeHeader(\"application/json\");\r\n  }\r\n  if (client != nullptr){\r\n    if (!client-\u003econnected()){\r\n      client-\u003econnect(host, httpsPort);\r\n    }\r\n  }\r\n  else{\r\n    Serial.println(\"Error creating client object!\");\r\n  }\r\n  \r\n  // Create json object string to send to Google Sheets\r\n  payload = payload_base + \"\\\"\" + run + \",\" + time_start + \",\" + time_finish + \"\\\"}\";\r\n  \r\n  // Publish data to Google Sheets\r\n  Serial.println(\"Publishing data...\");\r\n  Serial.println(payload);\r\n  if(client-\u003ePOST(url, host, payload)){ \r\n    // do stuff here if publish was successful\r\n  }\r\n  else{\r\n    // do stuff here if publish was not successful\r\n    Serial.println(\"Error while connecting\");\r\n  }\r\n}\r\n```\r\nI'm grateful for any advice on a better solution, thanks\r\n\r\nHardware: Wemos D1 mini","author":{"url":"https://github.com/franz134","@type":"Person","name":"franz134"},"datePublished":"2022-11-22T15:55:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/8/Google-Sheets-Logging/issues/8"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:6b9ac163-0959-4432-bcd3-3a86c2192dc1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idACF6:6C38E:4E1EB7:6EFE48:6A4BCBD1
html-safe-nonce07e589bdaa2ed1044d708a62d4756e7a7bf056a5c12beb972f87d6fe13ed7a69
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0Y2OjZDMzhFOjRFMUVCNzo2RUZFNDg6NkE0QkNCRDEiLCJ2aXNpdG9yX2lkIjoiNDI2NzYxMDcwMTE1OTk3NTg5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacd14b3c5ec013732ca4ecdc1a24cf78e6dbd78c71db43ac244eeb17bdab4676bd
hovercard-subject-tagissue:1460133939
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/StorageB/Google-Sheets-Logging/8/issue_layout
twitter:imagehttps://opengraph.githubassets.com/eef930ffbac67abb9df6d0a5d0bca044604fd05f695392a772283c2f4d9e4ef5/StorageB/Google-Sheets-Logging/issues/8
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/eef930ffbac67abb9df6d0a5d0bca044604fd05f695392a772283c2f4d9e4ef5/StorageB/Google-Sheets-Logging/issues/8
og:image:altHey, I'm trying to create a kind of stopwatch and for the best responsibility, I use an interrupt, from which the subroutine to send the data is called. (When I was trying the raw example it worked...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamefranz134
hostnamegithub.com
expected-hostnamegithub.com
None14aa00ce5bdb34d0eefb5facbffd7de9e144c688d8a93ef8df902d5f94b51dd7
turbo-cache-controlno-preview
go-importgithub.com/StorageB/Google-Sheets-Logging git https://github.com/StorageB/Google-Sheets-Logging.git
octolytics-dimension-user_id44729718
octolytics-dimension-user_loginStorageB
octolytics-dimension-repository_id257144994
octolytics-dimension-repository_nwoStorageB/Google-Sheets-Logging
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id257144994
octolytics-dimension-repository_network_root_nwoStorageB/Google-Sheets-Logging
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release58b8f89190447502561829f30862aa0a99d53367
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/StorageB/Google-Sheets-Logging/issues/8#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FStorageB%2FGoogle-Sheets-Logging%2Fissues%2F8
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FStorageB%2FGoogle-Sheets-Logging%2Fissues%2F8
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=StorageB%2FGoogle-Sheets-Logging
Reloadhttps://github.com/StorageB/Google-Sheets-Logging/issues/8
Reloadhttps://github.com/StorageB/Google-Sheets-Logging/issues/8
Reloadhttps://github.com/StorageB/Google-Sheets-Logging/issues/8
StorageB https://github.com/StorageB
Google-Sheets-Logginghttps://github.com/StorageB/Google-Sheets-Logging
Notifications https://github.com/login?return_to=%2FStorageB%2FGoogle-Sheets-Logging
Fork 34 https://github.com/login?return_to=%2FStorageB%2FGoogle-Sheets-Logging
Star 155 https://github.com/login?return_to=%2FStorageB%2FGoogle-Sheets-Logging
Code https://github.com/StorageB/Google-Sheets-Logging
Issues 8 https://github.com/StorageB/Google-Sheets-Logging/issues
Pull requests 0 https://github.com/StorageB/Google-Sheets-Logging/pulls
Actions https://github.com/StorageB/Google-Sheets-Logging/actions
Projects https://github.com/StorageB/Google-Sheets-Logging/projects
Security and quality 0 https://github.com/StorageB/Google-Sheets-Logging/security
Insights https://github.com/StorageB/Google-Sheets-Logging/pulse
Code https://github.com/StorageB/Google-Sheets-Logging
Issues https://github.com/StorageB/Google-Sheets-Logging/issues
Pull requests https://github.com/StorageB/Google-Sheets-Logging/pulls
Actions https://github.com/StorageB/Google-Sheets-Logging/actions
Projects https://github.com/StorageB/Google-Sheets-Logging/projects
Security and quality https://github.com/StorageB/Google-Sheets-Logging/security
Insights https://github.com/StorageB/Google-Sheets-Logging/pulse
"Error! Not connected to host." when using ISRhttps://github.com/StorageB/Google-Sheets-Logging/issues/8#top
https://github.com/franz134
franz134https://github.com/franz134
on Nov 22, 2022https://github.com/StorageB/Google-Sheets-Logging/issues/8#issue-1460133939
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.