Search found 81 matches

by ajie_dirgantara
Wed Oct 18, 2017 7:54 am
Forum: Programs, Libraries and Tools
Topic: uasyncio get_event_loop() methods
Replies: 2
Views: 2839

uasyncio get_event_loop() methods

when I do this in REPL : >>>import uasyncio >>>loop = uasyncio.get_event_loop() >>> loop. <--press Tab--> __init__ remove_reader wait __qualname__ add_writer remove_writer add_reader __module__ It only shown above method? unlike usual upy modules, I've got all it class member.
by ajie_dirgantara
Tue Oct 17, 2017 10:36 am
Forum: General Discussion and Questions
Topic: _thread limitation on stmhal ports
Replies: 2
Views: 2336

Re: _thread limitation on stmhal ports

pythoncoder wrote:
Tue Oct 17, 2017 9:49 am
I think threading is fairly RAM intensive. If you can tolerate cooperative scheduling uasyncio is highly efficient: I have tested with hundreds of coroutines.


I'll stick with _thread module for now. But I'll take a look later. Thanks.
by ajie_dirgantara
Tue Oct 17, 2017 9:27 am
Forum: General Discussion and Questions
Topic: _thread limitation on stmhal ports
Replies: 2
Views: 2336

_thread limitation on stmhal ports

I am using stmhal port, and been using _thread module. Is the thread creation limited at 8 threads only? because when I try to start 9th thread it raise MemoryError exception : Traceback (most recent call last): File "main.py", line 221, in <module> File "main.py", line 219, in main File "main.py", ...
by ajie_dirgantara
Tue Oct 17, 2017 6:24 am
Forum: Development of MicroPython
Topic: pass bytearray from C code to mpy in timer ISR
Replies: 1
Views: 1981

pass bytearray from C code to mpy in timer ISR

I am trying to return a bytearray from C code as below : STATIC mp_obj_t prog_getAllData(void) { return mp_obj_new_bytearray(sizeof(dataDI.bytes), (mp_obj_t*)&dataDI.bytes); } STATIC MP_DEFINE_CONST_FUN_OBJ_0(prog_getAllData_obj, prog_getAllData); when I used it as : import prog prog.getAllData() it...
by ajie_dirgantara
Wed Oct 11, 2017 11:45 am
Forum: General Discussion and Questions
Topic: Dealing with partial code tampering on external memory
Replies: 19
Views: 10890

Re: Dealing with partial code tampering on external memory

Yes, the meters at the pump station measure consumption of many customers. And yes, there are always discrepancies — those are included in the budget, and ignored as long as they are not too big. But as soon as someone starts stealing water (or there is some other problem causing the discrepancy), ...
by ajie_dirgantara
Wed Oct 11, 2017 11:21 am
Forum: General Discussion and Questions
Topic: Dealing with partial code tampering on external memory
Replies: 19
Views: 10890

Re: Dealing with partial code tampering on external memory

Based on the discussion above, I am agreed that hardware level protection is a "killer" feature. There won't be any discussion forward if it is implemented. But, as a *cost effective* and *good enough* solution, provide that the device has : - MCU - Battery - Switch - Codes on external storage Then ...
by ajie_dirgantara
Wed Oct 11, 2017 11:01 am
Forum: General Discussion and Questions
Topic: Dealing with partial code tampering on external memory
Replies: 19
Views: 10890

Re: Dealing with partial code tampering on external memory

But then you are not selling water meters. I can go to a shop and buy a water meter, open it, look inside, disassemble it, reassemble again, etc., and there is nothing that prevents me from doing that with the property I have bought. However, I can't use that to bill my water consumption, because t...
by ajie_dirgantara
Wed Oct 11, 2017 10:51 am
Forum: General Discussion and Questions
Topic: Dealing with partial code tampering on external memory
Replies: 19
Views: 10890

Re: Dealing with partial code tampering on external memory

In that case I would recommend re-flashing the original firmware every time the item is returned before renting it again. How can re-flashing the original firmware solve the problem? in above example even (B) restore original firmware so they won't get caught by (A). I'm sorry, I didn't read your d...
by ajie_dirgantara
Wed Oct 11, 2017 5:43 am
Forum: General Discussion and Questions
Topic: Dealing with partial code tampering on external memory
Replies: 19
Views: 10890

Re: Dealing with partial code tampering on external memory

A forum search will show that this topic has been extensively discussed. IIRC the conclusion was that the best that can be done is to implement the application as frozen bytecode stored in the device's Flash memory. If an attacker has physical access to the device there is little to stop them from ...
by ajie_dirgantara
Wed Oct 11, 2017 3:42 am
Forum: General Discussion and Questions
Topic: compiling for small RAM/ROM platforms
Replies: 6
Views: 4743

Re: compiling for small RAM/ROM platforms

Another thing to consider is to remove unused python compile-able modules in /modules.