kaluma: HTTP Module not working on Raspberry Pi Pico W
Hi there
I’m trying the HTTP module on Raspberry Pi Pico W, but it doesn’t work. There doesn’t seem to be any particular error.
I tried the following code.
const { WiFi } = require('wifi');
const wifi = new WiFi();
const http = require('http');
wifi.scan((err, scanResults) => {
if (err) {
console.error(err);
} else {
wifi.connect({ ssid: 'SSID', password: 'PASS' }, (err) => {
if (err) {
console.error(err);
} else {
console.log(`-----Wi-Fi connected-----`);
try {
http.get({ host: 'hoge.hoge.com', path: '/' }, function (response) {
response.on('data', function (chunk) {
console.log('received: ', chunk);
});
});
} catch (error) {
console.log(`---`);
console.log(error);
}
}
});
}
});
It seems that the people commenting in this discussion are having the same issue.
Anyone have any ideas?
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 2
- Comments: 21
Commits related to this issue
- Pico-w network driver: URL support using dns in lwip - issue #570 — committed to kaluma-project/kaluma by communix a year ago
- Disable Disable automatic chunked header - some http server do not - issue #570 — committed to kaluma-project/kaluma by communix a year ago
@AcousticTypewriter @anubhavgupta I finally found the issue in the http code. please try it with the attached test FW and let me know your test result. kaluma-rp2-pico-w-1.1.0-beta.2_0624_http_get_test.uf2.zip
I tested with this test code. The host in the http header is needed for the “httpbin.org”.
@anubhavgupta Thank you let me check that point!!!
same result, when i try with ip address.
@anubhavgupta Thanks to your help I found out that current network driver does not support URLs. Let me implement URL feature in the pico-w network driver.