Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 25 09:45
    slaff labeled #2522
  • Jun 25 09:45
    slaff milestoned #2522
  • Jun 25 08:17
    mikee47 edited #2522
  • Jun 25 08:03
    mikee47 synchronize #2522
  • Jun 25 07:40
    mikee47 synchronize #2522
  • Jun 25 07:26
    mikee47 opened #2522
  • Jun 23 20:49
    Matzz opened #2521
  • Jun 22 12:27
    slaff milestoned #1939
  • Jun 22 12:27
    slaff demilestoned #1939
  • Jun 22 09:47
    slaff opened #2520
  • Jun 22 09:47
    slaff milestoned #2520
  • Jun 22 09:47
    slaff labeled #2520
  • May 31 14:17
    slaff unlabeled #2516
  • May 31 14:17
    slaff unlabeled #2497
  • May 31 14:17
    slaff unlabeled #2519
  • May 31 14:17
    slaff closed #2519
  • May 31 11:06
    slaff labeled #2519
  • May 31 11:06
    slaff milestoned #2519
  • May 31 11:06
    slaff opened #2519
  • May 31 10:53
    slaff milestoned #2518
Vity
@Vity01
I have a question related to the Sming BME280 library - it seems to be outdated against official github https://github.com/adafruit/Adafruit_BME280_Library
Does Sming requires some code updates/patches to get it work or I can use the library directly? Where are the optional Sming libraries located in Github?
3 years ago there was some initiative to be able to use Arduino libs without additional modification.
Mike
@mikee47
That particular library doesn't require patches at its current version. I've just updated it to latest and it's missing Adafruit_I2CDevice so would require some work to get it there. I guess the question ATM is whether the later versions have bugfixes or features you require?
Vity
@Vity01
the Ada_BME280 library requires also https://github.com/adafruit/Adafruit_Sensor and https://github.com/adafruit/Adafruit_BusIO
I just need it to make (their) examples compilable
Vity
@Vity01
there might be a side effect for other Adafruit libs in Sming
Vity
@Vity01

I found another issue with the flashing on Windows make flash

...
ESPTOOL2 out/Esp8266/debug/firmware/rom0.bin
SSL support disabled
make[1]: Nothing to be done for `application'.
make[1]: Leaving directory `/c/tools/Sming/samples/Basic_Blink'
Killing Terminal to free COM5
/bin/sh: : command not found
make: [kill_term] Error 127 (ignored)
WriteFlash 0x00000=out/Esp8266/debug/firmware/rboot.bin 0x000fa000=out/Esp8266/debug/firmware/partitions.bin 0x00002000=out/Esp8266/debug/firmware/rom0.bin  0x000fc000=/C/tools/Sming/Sming/Arch/Esp8266/Components/esp8266/ESP8266_NONOS_SDK/bin/esp_init_data_default.bin
Traceback (most recent call last):
  File "c:\tools\Sming\Sming\Components\Storage\Tools\hwconfig\hwconfig.py", line 114, in <module>
    main()
  File "c:\tools\Sming\Sming\Components\Storage\Tools\hwconfig\hwconfig.py", line 106, in main
    output = globals()['handle_' + args.command](args, config, part)
  File "c:\tools\Sming\Sming\Components\Storage\Tools\hwconfig\hwconfig.py", line 52, in handle_flashcheck
    filesize = os.path.getsize(filename)
  File "c:\Python310\lib\genericpath.py", line 50, in getsize
    return os.stat(filename).st_size
FileNotFoundError: [WinError 3] The system cannot find the path specified: '/C/tools/Sming/Sming/Arch/Esp8266/Components/esp8266/ESP8266_NONOS_SDK/bin/esp_init_data_default.bin'
make: *** [flash] Error 1

The file c:\tools\Sming\Sming\Arch\Esp8266\Components\esp8266\ESP8266_NONOS_SDK\bin\esp_init_data_default.bin is there, but it looks like it's used somewhere where the path is not inflated into Windows path

Mike
@mikee47
I've started a PR #2407 which updates the library. Also, only requires #include <Adafruit_BME280_Library>. Perhaps you could test it?
Re. problem with flashing, the 'file not found' relates to '/C/tools/...' but previous info. indicates path should be '/c/tools/...'. Windows doesn't care but Make does. I suspect this is related to #2000. Try a make config-clean clean components-clean then rebuild.
Mike
@mikee47
Ignore that last comment. The problem is in Components/Storage/Tools/hwconfig/hwconfig.py line 52, requires filesize = os.path.getsize(fixpath(filename)). NB. I develop on Windows but haven't encountered this problem - I switched to WSL2 as it's considerably faster. I'll get a fix submitted shortly once I've checked it.
Vity
@Vity01
@mikee47 thanks for the PR, I will try it , it looks like I am not unable to build up I2C and I hope the newer library contains some fix
Yeah, meanwhile I disabled the filesize safety check - it will work for you in WSL2 because /c/ path works there
Mike
@mikee47
@Vity01 I've identified the likely problem with the new BME280 library, changes pushed to update/adafruit-bme280 branch. You'll need a git pull. Also updated adafruit libraries so will requiremake submodules-clean before building.
1 reply
vesley
@vesley
Hello @slaff, FileStream worked, but I have two problems with the file upload.
  1. When I initialize the FileStream in the fileUploadMapper, I don't have the file name. I put a static name for testing, but I want to store the file with the name provided by the multipart/form-data request.
  2. Before persisting the file I want to check if there is enough storage space on the SPIFFS file system and if the file name is not bigger than 32 characters (as SPIFFS doesn't allow filenames with more than 32 characters). If this conditions are not met I want not to store the file.
    Is there a way to achieve what I want with Sming?
16 replies
Vity
@Vity01
hurray 97% for v4.5.0 :-)
slaff
@slaff

gpio: gpio_set_level(215): GPIO output gpio_num error

Should be fixed in the latest develop

slaff
@slaff
@/all We are planning a new release for 25th of December. Please test the code in the latest develop branch and let us know if you have noticed some issues.
vesley
@vesley
Hello @mikee47 & @slaff, is it possible to add a new method signature for HttpResourceTree::setDefault, which allows to register a default path and a plugin or a list of plugins? I want to secure all registered paths with basic authentication. Currently there is no way to secure the default path.
vesley
@vesley

Hello @mikee47 & @slaff, is it possible to add a new method signature for HttpResourceTree::setDefault, which allows to register a default path and a plugin or a list of plugins? I want to secure all registered paths with basic authentication. Currently there is no way to secure the default path.

I found out that I can use

server.path.set("*", handler, plugin)

to set a handler for the default path with a plugin.

slaff
@slaff
@/all Merry Christmas everyone - we have a present for you: https://github.com/SmingHub/Sming/releases/tag/4.5.0
Mike
@mikee47
@slaff Awesome teamwork and Merry Christmas to all !
kmihaylov
@kmihaylov

Hello. I'm trying to use multiple SPI buses (one for SD card and another one for some ICs). The global SPI object works fine (I setup it on SpiBus::HSPI). But I struggle to set secondary SPI object utilizing VSPI. I declare it with SpiClass spi2 and later try to spi2.setup(SpiBus::SPI3, SDpins);.

The application builds fine, but on startup I get 392117 [SPI] Bus #3 already assigned

These are the exact init lines for SPI:

    SPI.setup(SpiBus::HSPI, spispi);
    SPI.begin();

    spi2.setup(SpiBus::SPI3, SDpins);
    spi2.begin();
Mike
@mikee47
I've just tested this and no issue. Can you post the complete code please? Open an issue if necessary.
kmihaylov
@kmihaylov
Thank you @mikee47 Let me check precisely and I'll post my results.
kmihaylov
@kmihaylov

@mikee47 , you're correct, as usual. I'm using the SDCard library. I did spi2.begin() before runTest(); that triggers SDCard_begin(PIN_CARD_SS, SPI_FREQ_LIMIT). This was the reason for the 'already assigned' bus.

It is possible that SDCard_begin() somehow overwrites stuff for the global SPI object? I'm loosing communication with the ICs on SPI's bus after runTest();.

I write the app with both SPI and spi2 buses and the first time after flashing both the SD card (on spi2) and the ICs on SPI's bus work OK. On the second restart of the board, however, the devices on the SPI bus do not work. I tried also flashinit and it still has this strange behavior.

kmihaylov
@kmihaylov
@mikee47 Well, my board is running now. I don't know how the above mentioned issue actually happens. What I found is that SPI and GPIO pins configuration might be tricky. Namely, if I set some GPIO pins (input/output) after SPI.setup(), then SPI might brake. I changed the order of some GPIO initialization functions and now the board is alive. I might have missed something and later I may try to reproduce this. Also I prepared pretty basic code to test (with MISO<->MOSI pins shorted) 2 SPI instances. https://pastebin.com/3w43sgPT (till 07.03.2023)
Anyway, thank you @mikee47 for your work on Sming and for your time providing support! Also thank you @slaff for managing and supporting the project!
slaff
@slaff
@/all we will release at the end of the month Sming v4.6. Help us find bugs by testing the latest develop version on your devices and report any issues. You can read more about the new features from here: #2509
vesley
@vesley

Hello @slaff, hello @mikee47, I'm playing with the Basic_Ota sample. I can successfully flash rom0 and rom1. But the spiff partition is only flashed when rom0 is written. When rom1 is written, then I see following message in the console:

Updating...
52062981 Partition 'spiffs1' not found

As there is only one spiffs partition, it is always 'spiffs0'. There is no 'spiffs1'. How can I determine the spiffs partition when rom1 is written?

The spiff partition is determined in the example with following lines:

    auto spiffsPart = findSpiffsPartition(part);
    if(spiffsPart) {
        // use user supplied values (defaults for 4mb flash in hardware config)
        otaUpdater->addItem(SPIFFS_URL, spiffsPart, new Storage::PartitionStream(spiffsPart));
    }

When part=rom1 then no spiff partition is found and therefore the update is skipped.

13 replies