Code: Select all
import gc def do_beginning(): import weather_station return weather_station.main() def do_end(data): import send_and_finish send_and_finish.main(data) data = do_beginning() gc.collect() do_end(data)
What is the best way forward here? I split up the weather station code into several .mpy modules that are called by functions like do_beginning() and do_end() (from within weather_station.mpy). I thought that once the imported module went out of scope that it would be gone from memory, or at least that it would mostly be gone.
If I can figure out how to free up the memory, this thing will be ready for production. Of course, I'm still waiting on a few parts from China, but that's another issue.